Commit 3d85d07c by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !23
2 parents 88f4bdf2 26933bc6
Showing 110 changed files with 1796 additions and 1461 deletions
......@@ -139,6 +139,10 @@ module.exports = {
}
],
"spaced-comment": [2, "always"],
"prefer-const": 2
"prefer-const": 2,
"node/no-callback-literal": 'off',
"no-unused-expressions": "off",
camelcase: 'off',
"no-undef": 'off'
}
}
module.exports = {
plugins: {
autoprefixer: {}
}
}
module.exports = {
plugins: {
// tailwindcss: {},
autoprefixer: {}
// "postcss-px-to-viewport": {
// unitToConvert: "rem", // 要转化的单位
// viewportWidth: 25, // UI设计稿的宽度
// unitPrecision: 6, // 转换后的精度,即小数点位数
// propList: ["*"], // 指定转换的css属性的单位,*代表全部css属性的单位都进行转换
// viewportUnit: "px", // 指定需要转换成的视窗单位,默认vw
// fontViewportUnit: "px", // 指定字体需要转换成的视窗单位,默认vw
// selectorBlackList: ["wrap"], // 指定不转换为视窗单位的类名,
// minPixelValue: 1, // 默认值1,小于或等于1px则不进行转换
// mediaQuery: true, // 是否在媒体查询的css代码中也进行转换,默认false
// replace: true, // 是否转换后直接更换属性值
// exclude: [/node_modules/], // 设置忽略文件,用正则做目录名匹配
// landscape: false // 是否处理横屏情况
// }
}
}
language: node_js
node_js: stable
cache:
directories:
- "node_modules"
branches:
only:
- master
script:
- npm run build:travis
before_install:
- ./qshell account $AK $SK
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
after_success:
- ./qshell qupload qiniu-config
- ./qshell cdnrefresh -dirs cdnrefresh-dirs.txt
\ No newline at end of file
MIT License
Copyright (c) 2018 李杨
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
......@@ -4,6 +4,8 @@
[Gitee](https://gitee.com/fairyever/d2-admin-start-kit)
预发布账号: yfbyyb a123456
从 develop 分支号 dev_v4.4.0 本来用来开发审核以及报表功能版本, wangql_dev_v4.4.0 已开发部分对应需求,未往 dev_v4.4.0 版本合并,因此目前 dev_v4.4.0 分支无用
从 develop 拉分支号 dev_v4.5.1 用来开发转化加 V4.5.0 功能需求
从 dev_v4.5.0 拉分支号 dev_v4.5.2 用来新建菜单对应现在的虚拟对公账户功能,以前的菜单保留以防万一
......@@ -29,3 +31,9 @@ dev_4.12.0_0927 版本上线后已往主干 develop 以及 master 上合并
从 develop 上拉取分支 dev_4.12.1 对应 1010 紧急版本
dev_4.13.0 分支以上线并往 develop 以及 master 上合并
从 develop 上拉取分支 dev_4.14.0 对应 11 月 商品改版+场景配置 版本
提测由于部署问题,直接从 dev_4.14.0 拉取 dev_4.14.1 代码相同的分支做部署
12 月大版本下部分 从测试中的分支 dev_4.14.1 拉取 dev_4.14.2 分支去做 清分及对账优化 版本,待 dev_4.14.1 上线后将代码合并进开发中的 dev_4.14.2
......@@ -7,8 +7,8 @@
"serve": "vue-cli-service serve",
"start": "set NODE_OPTIONS=--openssl-legacy-provider && npm run serve",
"dev": "set NODE_OPTIONS=--openssl-legacy-provider && npm run serve",
"build": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --no-module",
"build:nomock": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode nomock",
"build": " vue-cli-service build --no-module",
"build:nomock": "vue-cli-service build --mode nomock",
"build:travis": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode travis",
"lint": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint --fix",
"test:unit": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service test:unit",
......@@ -38,11 +38,11 @@
"js-cookie": "^2.2.0",
"js-md5": "^0.7.3",
"jspdf": "^2.5.1",
"lodash": "^4.17.11",
"lowdb": "^1.0.0",
"nprogress": "^0.2.0",
"qrcodejs2": "^0.0.2",
"qs": "^6.8.0",
"rfdc": "^1.3.0",
"screenfull": "^4.2.0",
"sha1": "^1.1.1",
"speed-measure-webpack-plugin": "^1.5.0",
......@@ -77,9 +77,8 @@
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-vue": "^7.0.0",
"jest": "^27.1.0",
"postcss": "^8.4.16",
"postcss-loader": "^7.0.1",
"postcss-preset-env": "^7.7.2",
"postcss-px-to-viewport": "^1.1.1",
"sass": "^1.18.0",
"sass-loader": "^7.1.0",
"script-loader": "^0.7.2",
......
> 1%
last 2 versions
not ie <= 8
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
module.exports = {
plugins: {
autoprefixer: {}
}
}
# filters-dayjs
\ No newline at end of file
module.exports = {
presets: [
'@vue/app'
]
}
This diff could not be displayed because it is too large.
{
"name": "@d2-admin/filters-dayjs",
"version": "1.0.3",
"main": "dist/@d2-admin/filters-dayjs.common.js",
"scripts": {
"build": "vue-cli-service build --target lib --name @d2-admin/filters-dayjs --entry src/main.js"
},
"dependencies": {
"core-js": "^2.6.5",
"dayjs": "^1.8.12",
"vue": "^2.6.6"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.0.0",
"@vue/cli-service": "^3.0.0",
"vue-template-compiler": "^2.5.21"
}
}
// 日期时间相关 filter
// https://github.com/iamkun/dayjs/blob/master/docs/zh-cn/API-reference.md
import dayjs from 'dayjs'
// 对象代理
const P = Day => {
return new Proxy(Day, {
get (target, key) {
if (dayjs.isDayjs(target)) {
// 是 Dayjs 对象,正常返回
return target[key]
} else {
// 不是 Dayjs 对象
if (dayjs(target).isValid()) {
// 尝试帮用户解析成 Dayjs 对象
return dayjs(target)[key]
} else {
// 无法解析
return function () {
return '无效日期'
}
}
}
},
set (target, key, value) {
target[key] = value
}
})
}
export default {
// ---------- [ dayjs 解析 ] ----------
// 时间字符串 | Date 对象 | Unix 时间戳 (毫秒)
day: value => dayjs(value),
// Unix 时间戳 (秒)
date_unix: value => dayjs.unix(value),
// ---------- [ 获取 ] ----------
date_year: Day => P(Day).year(),
date_month: Day => P(Day).month(),
date_date: Day => P(Day).date(),
date_day: Day => P(Day).day(),
date_hour: Day => P(Day).hour(),
date_minute: Day => P(Day).minute(),
date_second: Day => P(Day).second(),
date_millisecond: Day => P(Day).millisecond(),
// ---------- [ 设置 ] ----------
// date | day | month | year | hour | minute | second | millisecond
// 对大小写不敏感
date_set: (Day, unit, value) => P(Day).set(unit, value),
// ---------- [ 操作 ] ----------
// 增加
date_add: (Day, value, unit) => P(Day).add(value, unit),
// 减少
date_subtract: (Day, value, unit) => P(Day).subtract(value, unit),
// 开头时间
date_startof: (Day, unit) => P(Day).startOf(unit),
// 末尾时间
date_endof: (Day, unit) => P(Day).endOf(unit),
// ---------- [ 显示 ] ----------
// 格式化
date_format: (Day, setting = 'YYYY-MM-DD HH:mm:ss') => P(Day).format(setting),
// 时间差
date_diff: (Day, Day2 = '', unit = 'millisecond', accurate = false) => P(Day).diff(dayjs(Day2), unit, accurate),
// Unix 时间戳 (毫秒)
date_value_millisecond: Day => P(Day).valueOf(),
// Unix 时间戳 (秒)
date_value_second: Day => P(Day).unix(),
// 月份的天数
date_days_in_month: Day => P(Day).daysInMonth(),
// Date 对象
date_to_date: Day => P(Day).toDate(),
// JSON
date_to_json: Day => P(Day).toJSON(),
// ISO8601 格式
date_to_iso: Day => P(Day).toISOString(),
// 字符
date_to_string: Day => P(Day).toString(),
// ---------- [ 查询 ] ----------
// 是否之前
date_is_before: (Day, Day2, unit = 'millisecond') => P(Day).isBefore(dayjs(Day2), unit),
// 是否之后
date_is_after: (Day, Day2, unit = 'millisecond') => P(Day).isAfter(dayjs(Day2), unit),
// 是否相同
date_is_same: (Day, Day2, unit = 'millisecond') => P(Day).isSame(dayjs(Day2), unit)
}
import filters from './filters'
const vueFiltersDate = {
install: function (Vue, options) {
Object.keys(filters).forEach(name => {
Vue.filter(name, filters[name])
})
}
}
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(vueFiltersDate)
}
export default vueFiltersDate
This diff could not be displayed because it is too large.
{
"src_dir" : "/home/travis/build/d2-projects/d2-admin-start-kit/dist",
"bucket" : "d2-admin-start-kit",
"ignore_dir" : false,
"overwrite" : true,
"check_exists" : true,
"check_hash" : true,
"check_size" : true,
"rescan_local" : true,
"skip_file_prefixes" : "test,demo,",
"skip_path_prefixes" : "hello/,temp/",
"skip_fixed_strings" : ".svn,.git",
"skip_suffixes" : ".DS_Store,.exe",
"log_file" : "upload.log",
"log_level" : "info",
"log_rotate" : 1,
"log_stdout" : false
}
\ No newline at end of file
No preview for this file type
......@@ -18,7 +18,7 @@ export default {
</script>
<style lang="scss">
@import '~@/assets/style/public-class.scss';
@import "~@/assets/style/public-class.scss";
.el_table {
thead {
th {
......
......@@ -74,3 +74,45 @@ export function submitReviewResult(data) {
data.method = `${path2}upgradedGoods.submitReviewResult`
return request(data, 'post')
}
// 新增编辑商品
export function addOrEditBaseGoods(data) {
data.method = `${path}basegoods.insertOrUpdate`
return request(data, 'post')
}
// 获取商品列表
export function getBaseGoodsList(data) {
data.method = `${path}basegoods.page`
return request(data, 'post')
}
// 获取按规格分配 门店维度数据转为规格维度展示
export function getSpecDataByMerchent(data) {
data.method = `dj.basegoodsmerchantref.specification.getByBaseGoodsId`
return request(data, 'post')
}
// 按规格分配保存
export function saveAssignBySpec(data) {
data.method = 'dj.basegoodsmerchantref.specification.insertOrUpdate'
return request(data, 'post')
}
// 分配门店 统一分配保存
export function saveAssignByMerchant(data) {
data.method = 'dj.basegoodsmerchantref.stores.insertOrUpdate'
return request(data, 'post')
}
// 获取场景关联门店/园区店列表
export function getMerchantListByScene(data) {
data.method = `${path}servicemerchantref.listShopWithScene`
return request(data, 'post')
}
// 获取场景-类目-素材三级数据列表
export function getThiredMaterialList(data) {
data.method = `${path}goods.type.querySceneCategoryGoods`
return request(data, 'post')
}
// 参考demo.js 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
import * as common from 'glsx-common'
import Vue from 'vue'
import { Message as message } from 'element-ui'
import util from '@/libs/util.js'
const token = util.cookies.get('token')
const fetchConfig = function(isEnv = true) {
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
// }
// 生产环境
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/619c87331072f92988f05a29/marketing/config')
// return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get('http://config-center-backend.test.glsx.com/glsxAdmin/config?moduleUrl=marketing').then(res => res.data)
// 测试环境
return new common.Http().get('https://oss-config.dev.glsx.com.cn/mock/619c87331072f92988f05a29/marketing/config')
};
(async function() {
const { response, request, request2, sign, secret, sign_common, request_common, request_merchant } = await fetchConfig(false)
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token } })
Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token } })
Vue.prototype.$http_merchant = new common.Http({ response, request: request_merchant, sign, secret, alert: message.error, headers: { token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: message.error, headers: { TGT: token } })
})()
const modulesFiles = require.context('./', true, /\.js$/)
// eslint-disable-next-line array-callback-return
const modules = modulesFiles.keys().reduce((modules, modulePath) => {
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
if (moduleName != 'entry') {
const value = modulesFiles(modulePath)
modules[moduleName] = value.default
}
return modules
}, {})
export default modules
import request from './request'
import RequestMethods from './request.methods'
import request from "./request"
import RequestMethods from "./request.methods"
const path = 'dj.api.'
const path2 = 'dj.api.smartcarlife.'
const path = "dj.api."
const path2 = "dj.api.smartcarlife."
export function getList(data) {
// data.method = `${path2}merchantSettleAccountRule.page.byMerchant`
data.method = `${path}servicemerchantref.shop.page`
// data.method = `${path}servicemerchantref.shop.page`
data.method = `${path}servicemerchantref.pageServiceMerchantRef`
return request(data)
}
......@@ -24,7 +25,7 @@ export function serviceGetMerchantList(data) {
// 获取已经关联的4s店商户号列表
export function getRefShopList(data) {
data.method = 'dj.api.smartcarlife.refedShop.merchantId.list'
data.method = "dj.api.smartcarlife.refedShop.merchantId.list"
return request(data)
}
......@@ -36,7 +37,7 @@ export function addServiceMerchant(data) {
// 获取园区店关联的服务商信息
export function getPartnerByYq(data) {
data.method = 'dj.smartcarlife.api.partnerMerchant.getByYq'
data.method = "dj.smartcarlife.api.partnerMerchant.getByYq"
return request(data, RequestMethods.POST)
}
......@@ -44,7 +45,7 @@ export function getPartnerByYq(data) {
// 获取财务设置进度
export function getRuleProgressApi(data) {
data.method = `${path2}merchantSettleAccountRule.get.progress`
return request(data, 'post')
return request(data, "post")
}
export function updateRule(data) {
......@@ -59,43 +60,43 @@ export function sendSms(data) {
export function getAdminInfo(data) {
data.method = `${path2}sms.merchantCompantSms.adminInfo`
return request(data, 'post')
return request(data, "post")
}
/** 根据商户号获取商户的财务结算规则 */
export function getAccountRule(data) {
data.method = `${path2}merchantSettleAccountRule.get.byMerchantId`
return request(data, 'post')
return request(data, "post")
}
// 财务 - 获取服务4s店(包含园区店、服务商信息)详情
export function getShopDetail(data) {
data.method = `${path}servicemerchantref.shop.detail`
return request(data, 'post')
return request(data, "post")
}
// 获取分账规则
export function getDivisionRuleApi(data) {
data.method = `${path2}merchantDivisionRule.get.byMerchantId`
return request(data, 'post')
return request(data, "post")
}
// 修改分账规则
export function updateDivisionRuleApi(data) {
data.method = `${path2}merchantDivisionRule.update`
return request(data, 'post')
return request(data, "post")
}
// 财务 - 2 - 获取导流方
export function getMerchantLevelApi(data) {
data.method = `${path2}get.merchantLevel`
return request(data, 'post')
return request(data, "post")
}
// 财务 - 3 - 保存/验证金额
export function moneyValidApi(data) {
data.method = `${path2}divisionRuleTest.money.valid`
return request(data, 'post')
return request(data, "post")
}
// 财务 - 3 - websocket
......@@ -107,47 +108,71 @@ export function getWsUrlApi(data) {
// 商户管理 - 查看详情 - 修改入驻日期
export function entrydateUpdate(data) {
data.method = `${path2}entrydate.update`
return request(data, 'post')
return request(data, "post")
}
// 商户品牌-品牌设置
export function brandSetting(data) {
data.method = `${path2}merchantbrandmodel.listBrandWithSeries`
return request(data, 'post')
return request(data, "post")
}
// 商户品牌-配置车型
export function configureCar(data) {
data.method = `${path2}merchantbrandmodel.update`
return request(data, 'post')
return request(data, "post")
}
// 企微推送对象列表
export function pushObject(data) {
data.method = `${path2}merchantConcat.page`
return request(data, 'post')
return request(data, "post")
}
// 新建企微联系人
export function addContact(data) {
data.method = `${path2}merchantConcat.add`
return request(data, 'post')
return request(data, "post")
}
// 修改企微联系人
export function modifyContact(data) {
data.method = `${path2}merchantConcat.modify`
return request(data, 'post')
return request(data, "post")
}
// 导入企微联系人
export function importContact(data) {
data.method = `${path2}merchantConcat.import`
return request(data, 'post', ['file'])
return request(data, "post", ["file"])
}
// 删除企微联系人
export function removeContact(data) {
data.method = `${path2}merchantConcat.remove`
return request(data, 'post')
return request(data, "post")
}
//分页查询园区店
export function getyqMerchantList(data) {
data.method = `dj.smartcarlife.api.yqMerchant.pageList`
return request(data)
}
//分页查询服务商
export function getServiceList(data) {
data.method = `dj.smartcarlife.api.merchant.serviceList`
return request(data)
}
//获取4s店绑定的服务商和园区店信息
export function querySceneRefByShop(data) {
data.method = `${path}scenemerchantref.querySceneRefByShop`
return request(data)
}
// 场景-新增商户关联关系
export function addOrUpdateSceneMerchantRef(data) {
data.method = `${path2}shopMerchant.addOrUpdateSceneMerchantRef`
return request(data, RequestMethods.POST)
}
......@@ -41,3 +41,33 @@ export function exportGoodsList(data) {
data.method = `${path}goodsinfo.export`
return request(data, 'post')
}
// 获取场景下类目
export function getProductTypeBySceneId(data) {
data.method = `${path}goodsCategoryConfiguration.queryGoodsCategoryBySceneId`
return request(data, 'post')
}
// 获取品牌方/供应方
export function getBrandSupplyMerchant(data) {
data.method = `${path}goods.type.queryGoodsRelatedParty`
return request(data, 'post')
}
// 新增供应方
export function addBrandSupplyMerchant(data) {
data.method = `${path}goods.type.addGoodsRelatedParty`
return request(data, 'post')
}
// 编辑/删除供应方
export function editBrandSupplyMerchant(data) {
data.method = `${path}goods.type.editGoodsRelatedParty`
return request(data, 'post')
}
// 获取素材详情
export function getProductInfo(data) {
data.method = `${path}goodsinfo.get.byId`
return request(data, 'post')
}
import request from "./request"
import RequestMethods from "./request.methods"
const path = "dj.api.goodsCategoryConfiguration."
// 分页查询类目配置管理列表
export function getCategoryList(data) {
data.method = `${path}page`
return request(data)
}
// 新增商品类目
export function addGoodsCategory(data) {
data.method = `${path}addGoodsCategory`
return request(data, RequestMethods.POST)
}
// 编辑或者删除修改商品类目
export function editGoodsCategory(data) {
data.method = `${path}editGoodsCategory`
return request(data, RequestMethods.POST)
}
// 按照条件查询特色商品场景配置列表
export function featuredGoodsList(data) {
data.method = `${path}featuredGoodsList`
return request(data)
}
// 关联类目
export function editFeaturedGoods(data) {
data.method = `${path}editFeaturedGoods`
return request(data, RequestMethods.POST)
}
// 根据场景类型查询对应所有类目
export function queryGoodsCategoryBySceneId(data) {
data.method = `${path}queryGoodsCategoryBySceneId`
return request(data, RequestMethods.POST)
}
......@@ -7,7 +7,7 @@
import sha1 from "sha1"
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')
......@@ -20,7 +20,7 @@ const sign = (params, noSignAttr = []) => {
const secret = baseConfig?.axios?.secret
// console.log(secret)
delete params.sign
var objStr = qs.stringify(_.cloneDeep(params), {
var objStr = qs.stringify(deepClone(params), {
arrayFormat: "indices",
allowDots: true,
encodeValuesOnly: true
......
......@@ -71,3 +71,9 @@ export function exportExcel(data) {
data.method = `${path}common.query.async.exportExcel`
return request(data, RequestMethods.POST)
}
// 视频上传
export function uploadVideo(data) {
data.method = `${path}smartcarlife.common.uploadVideo`
return request(data, RequestMethods.POST, ["file"])
}
......@@ -3,6 +3,7 @@ import { Message, MessageBox, Loading } from "element-ui"
// import moment from 'moment'
import dayjs from "dayjs"
let loadingInstance = ""
export const Util = {
/**
* 简单alert
......@@ -225,28 +226,32 @@ export const Util = {
// * @param {*} obj
// */
deepClone: function (obj) {
// Handle the 3 simple types, and null or undefined or function
if (obj == null || typeof obj !== "object") return obj
// Handle Date
if (obj instanceof Date) {
const copy = new Date()
copy.setTime(obj.getTime())
return copy
}
// Handle Array or Object
if ((obj instanceof Array) | (obj instanceof Object)) {
const copy = obj instanceof Array ? [] : {}
for (var attr in obj) {
// if (Object.prototype.hasOwnProperty.call(attr)) {
if (obj.hasOwnProperty(attr)) {
copy[attr] = Util.deepClone(obj[attr])
// console.log("copy[attr] ", copy[attr])
}
}
return copy
}
throw new Error("Unable to clone obj! Its type isn't supported.")
const clone = require("rfdc")({ proto: false, circles: false })
return clone(obj)
},
// deepClone: function (obj) {
// // Handle the 3 simple types, and null or undefined or function
// if (obj == null || typeof obj !== "object") return obj
// // Handle Date
// if (obj instanceof Date) {
// const copy = new Date()
// copy.setTime(obj.getTime())
// return copy
// }
// // Handle Array or Object
// if ((obj instanceof Array) | (obj instanceof Object)) {
// const copy = obj instanceof Array ? [] : {}
// for (var attr in obj) {
// // if (Object.prototype.hasOwnProperty.call(attr)) {
// if (obj.hasOwnProperty(attr)) {
// copy[attr] = Util.deepClone(obj[attr])
// // console.log("copy[attr] ", copy[attr])
// }
// }
// return copy
// }
// throw new Error("Unable to clone obj! Its type isn't supported.")
// },
/**
* url下载文件
......
// 组件
import d2ContainerFull from './components/d2-container-full.vue'
import d2ContainerFullBs from './components/d2-container-full-bs.vue'
import d2ContainerGhost from './components/d2-container-ghost.vue'
import d2ContainerGhostBs from './components/d2-container-ghost-bs.vue'
import d2ContainerCard from './components/d2-container-card.vue'
import d2ContainerCardBs from './components/d2-container-card-bs.vue'
import d2ContainerFull from "./components/d2-container-full.vue"
import d2ContainerFullBs from "./components/d2-container-full-bs.vue"
import d2ContainerGhost from "./components/d2-container-ghost.vue"
import d2ContainerGhostBs from "./components/d2-container-ghost-bs.vue"
import d2ContainerCard from "./components/d2-container-card.vue"
import d2ContainerCardBs from "./components/d2-container-card-bs.vue"
// import d2Source from './components/d2-source.vue'
export default {
name: 'd2-container',
name: "d2-container",
props: {
// 容器样式
type: {
type: String,
required: false,
default: 'full'
default: "full"
},
// 滚动优化
betterScroll: {
......@@ -26,34 +26,44 @@ export default {
computed: {
// 始终返回渲染组件
component() {
if (this.type === 'card' && !this.betterScroll) return d2ContainerCard
if (this.type === 'card' && this.betterScroll) return d2ContainerCardBs
if (this.type === 'ghost' && !this.betterScroll) return d2ContainerGhost
if (this.type === 'ghost' && this.betterScroll) return d2ContainerGhostBs
if (this.type === 'full' && !this.betterScroll) return d2ContainerFull
if (this.type === 'full' && this.betterScroll) return d2ContainerFullBs
if (this.type === "card" && !this.betterScroll) return d2ContainerCard
if (this.type === "card" && this.betterScroll) return d2ContainerCardBs
if (this.type === "ghost" && !this.betterScroll) return d2ContainerGhost
if (this.type === "ghost" && this.betterScroll) return d2ContainerGhostBs
if (this.type === "full" && !this.betterScroll) return d2ContainerFull
if (this.type === "full" && this.betterScroll) return d2ContainerFullBs
else {
return 'div'
return "div"
}
}
},
render(h) {
const slots = [this.$slots.default]
if (this.$slots.header) slots.push(h('template', { slot: 'header' }, [this.$slots.header]))
if (this.$slots.footer) slots.push(h('template', { slot: 'footer' }, [this.$slots.footer]))
return h('div', {
ref: 'container',
class: 'container-component'
}, [
h(this.component, {
ref: 'component',
props: this.$attrs,
on: {
scroll: e => this.$emit('scroll', e)
}
}, slots)
// h(d2Source)
])
if (this.$slots.header)
slots.push(h("template", { slot: "header" }, [this.$slots.header]))
if (this.$slots.footer)
slots.push(h("template", { slot: "footer" }, [this.$slots.footer]))
return h(
"div",
{
ref: "container",
class: "container-component"
},
[
h(
this.component,
{
ref: "component",
props: this.$attrs,
on: {
scroll: (e) => this.$emit("scroll", e)
}
},
slots
)
// h(d2Source)
]
)
},
methods: {
// 返回顶部
......
No preview for this file type
<!-- 关联门店弹窗 -->
<template>
<d2-dialog
title="关联门店"
:is-visible.sync="relateStoreVisible"
width="70%"
btn-ok-label="关联"
@confirmDialog="handleRelateStoreConfirm"
@closeDialog="handleRelateStoreClose"
class="relateStore"
>
<d2-dialog title="关联门店"
:is-visible.sync="relateStoreVisible"
width="70%"
btn-ok-label="关联"
@confirmDialog="handleRelateStoreConfirm"
@closeDialog="handleRelateStoreClose"
class="relateStore">
<slot />
<el-row>
<el-col :span="12">
<el-table
ref="seletingTable"
:data="selectingData"
height="464px"
class="table"
border
@select="handleChange"
@select-all="handleAll"
>
<el-table-column
type="selection"
width="55"
align="center"
:selectable="selectable"
/>
<el-table-column
v-if="sourcePage != 'serviceStore'"
prop="yqMerchantName"
label="园区店名称"
align="center"
>
<el-row class="tableCon">
<!-- <el-col :span="12"> -->
<div class="tableBox">
<el-table ref="seletingTable"
:data="selectingData"
height="464px"
class="table"
border
@select="handleChange"
@select-all="handleAll">
<el-table-column type="selection"
width="55"
align="center"
:selectable="selectable" />
<el-table-column v-if="sourcePage != 'serviceStore'"
prop="yqMerchantName"
label="园区店名称"
align="center">
<template slot-scope="scope">
<span :class="{'red': !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)}">{{ scope.row.yqMerchantName }}</span>
<span
:class="{'red': !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)}">{{ scope.row.yqMerchantName }}</span>
</template>
</el-table-column>
<el-table-column
prop="merchantName"
label="4S店名称"
align="center"
>
<el-table-column prop="merchantName"
label="4S店名称"
align="center">
<template slot-scope="scope">
<span :class="{'red': !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)}">{{ scope.row.merchantName }}</span>
<el-tooltip
v-if="!scope.row.isSetUpgradeSettleRule"
popper-class="tooltip-class"
effect="dark"
content="该门店无配置财务分润规则,无法关联!"
placement="top"
>
<span
v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)"
class="tip-icon"
>?</span>
<span
:class="{'red': !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)}">{{ scope.row.merchantName }}</span>
<el-tooltip v-if="!scope.row.isSetUpgradeSettleRule"
popper-class="tooltip-class"
effect="dark"
content="该门店无配置财务分润规则,无法关联!"
placement="top">
<span v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)"
class="tip-icon">?</span>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<el-pagination
small
background
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-size="pageSize"
layout="total, prev, pager, next"
:total="total"
/>
</el-col>
<el-col :span="12">
<el-table
:data="selectedData"
class="table"
border
height="464px"
>
<el-table-column
v-if="sourcePage != 'serviceStore'"
prop="yqMerchantName"
label="园区店名称"
align="center"
/>
<el-table-column
prop="merchantName"
label="4S店名称"
align="center"
/>
<el-table-column
label="删除"
align="center"
width="50px"
>
<template slot-scope="scope">
<el-button
class="el-icon-delete"
@click="handleDelete(scope.row)"
type="text"
/>
</template>
</el-table-column>
</el-table>
</el-col>
<el-pagination small
background
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-size="pageSize"
layout="total, prev, pager, next"
:total="total" />
</div>
<!-- </el-col> -->
<!-- <el-col :span="12"> -->
<el-table :data="selectedData"
class="table tableBox"
border
height="464px">
<el-table-column v-if="sourcePage != 'serviceStore'"
prop="yqMerchantName"
label="园区店名称"
align="center" />
<el-table-column prop="merchantName"
label="4S店名称"
align="center" />
<el-table-column label="删除"
align="center"
width="50px">
<template slot-scope="scope">
<el-button class="el-icon-delete"
@click="handleDelete(scope.row)"
type="text" />
</template>
</el-table-column>
</el-table>
<!-- </el-col> -->
</el-row>
</d2-dialog>
</template>
......@@ -219,11 +197,17 @@ export default {
}
</script>
<style>
<style lang="scss">
.relateStore .table {
margin: 0 auto 20px !important;
width: 98%;
}
.relateStore .tableCon {
display: flex;
.tableBox {
flex: 1;
}
}
.service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell {
line-height: 26px !important;
......
......@@ -159,6 +159,10 @@ export default {
// 选择框-添加其他属性
selectAddAttr(value, targetItem) {
targetItem.changeAttr && targetItem.changeAttr(value, targetItem)
// 根据所选值 获取数据
if (targetItem.name == 'sceneType') {
this.$emit('handleChangeSelect', value)
}
},
handleInputDown(e, item) {
if (e.keyCode === 13 && item.hasOwnProperty('keyFn')) {
......
<!-- 表格+分页 -->
<template>
<div>
<el-table
:data="getListApi ? data : tableData"
v-loading="loading"
border
:highlight-current-row="true"
:stripe="true"
@sort-change="sortChange"
>
<el-table-column
align="center"
width="60px"
label="序号"
type="index"
:index="index=>index+(pagination.pageSize - 1) * pagination.pageCount + 1"
/>
<el-table-column
v-for="(item, index) in tableParams.tableColumns"
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
:min-width="item.minWidth"
:align="item.align||'center'"
:sortable="item.sortable"
>
<el-table :data="getListApi ? data : tableData"
v-loading="loading"
border
:highlight-current-row="true"
:stripe="true"
@sort-change="sortChange">
<el-table-column align="center"
width="60px"
label="序号"
type="index"
:index="index=>index+(pagination.pageSize - 1) * pagination.pageCount + 1" />
<el-table-column v-for="(item, index) in tableParams.tableColumns"
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
:min-width="item.minWidth"
:align="item.align||'center'"
:sortable="item.sortable">
<template slot-scope="scope">
<slot
v-if="item.addHtml"
:name="item.addHtml"
:scope="scope.row"
:prop="item.prop"
:mom-flag="item.momFlag"
/>
<slot v-if="item.addHtml"
:name="item.addHtml"
:scope="scope.row"
:prop="item.prop"
:mom-flag="item.momFlag" />
<template v-else-if="item.momFlag">
<div>
<span v-text="scope.row[item.prop]" />
<span
v-if="scope.row[item.momFlag] > 0"
class="el-icon-top"
/>
<span
v-else-if="scope.row[item.momFlag] < 0"
class="el-icon-bottom"
/>
<span v-if="scope.row[item.momFlag] > 0"
class="el-icon-top" />
<span v-else-if="scope.row[item.momFlag] < 0"
class="el-icon-bottom" />
<span v-else-if="scope.row[item.momFlag] == 0">--</span>
</div>
</template>
<template v-else-if="item.tagLabel">
<el-tag
v-if="!item.tagName"
:type="tableParams.tag.type[scope.row[item.prop]]"
v-text="tableParams.tag.label[scope.row[item.prop]]"
/>
<el-tag
v-else
:type="tableParams[item.tagName].type[scope.row[item.prop]]"
v-text="tableParams[item.tagName].label[scope.row[item.prop]]"
/>
<el-tag v-if="!item.tagName"
:type="tableParams.tag.type[scope.row[item.prop]]"
v-text="tableParams.tag.label[scope.row[item.prop]]" />
<el-tag v-else
:type="tableParams[item.tagName].type[scope.row[item.prop]]"
v-text="tableParams[item.tagName].label[scope.row[item.prop]]" />
</template>
<template v-else-if="item.formatter">
<span v-text="item.formatter(scope.row)" />
......@@ -71,36 +55,31 @@
</template>
</template>
</el-table-column>
<el-table-column
v-if="tableParams.tableOption"
label="操作"
:align="tableParams.tableOption.align||'center'"
:width="tableParams.tableOption.width||'200'"
fixed="right"
>
<el-table-column v-if="tableParams.tableOption"
label="操作"
:align="tableParams.tableOption.align||'center'"
:width="tableParams.tableOption.width||'200'"
fixed="right">
<template slot-scope="scope">
<slot
name="auth-button"
:scope="scope.row"
/>
<slot name="auth-button"
:scope="scope.row" />
</template>
</el-table-column>
</el-table>
<el-pagination
v-if="hasPage"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.pageSize"
:page-sizes="[10,20,30,40]"
:page-size="page.pageCount"
:total="getListApi ? total : tableTotal"
layout="sizes,total,->,prev,pager,next,jumper"
/>
<el-pagination v-if="hasPage"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.pageSize"
:page-sizes="[10,20,30,40]"
:page-size="page.pageCount"
:total="getListApi ? total : tableTotal"
layout="sizes,total,->,prev,pager,next,jumper" />
</div>
</template>
<script>
import { deepClone } from '@/common/util'
export default {
name: 'D2Table',
data() {
......@@ -187,7 +166,7 @@ export default {
if (!val[attr] && this.oldValue[attr]) {
this.getListApi ? this.refreshEmit() : this.$emit('refreshTable', this.page)
}
this.oldValue = _.cloneDeep(val)
this.oldValue = deepClone(val)
},
deep: true
}
......
<!-- 表格头部搜索 -->
<template>
<el-popover
placement="bottom"
title=""
width="150"
trigger="click"
v-model="isPopoverVisible"
>
<el-popover placement="bottom"
title=""
width="150"
trigger="click"
v-model="isPopoverVisible">
<block>
<p class="flex">
<el-checkbox
:indeterminate="isIndeterminate"
v-model="checkAll"
@change="handleCheckAllChange"
>
全选
<el-checkbox :indeterminate="isIndeterminate"
v-model="checkAll"
@change="handleCheckAllChange">
全选
</el-checkbox>
<el-button
@click="handleConfirm"
type="text"
>
确定
<el-button @click="handleConfirm"
type="text">
确定
</el-button>
</p>
<el-checkbox-group
v-model="checkedList"
@change="handleCheckedChange"
>
<el-checkbox
v-for="item in baseData[optionConfig.searchItemName]"
:label="item[optionConfig.optionId]"
:key="item[optionConfig.optionId]"
@change="handleCheckedChange"
>
{{ item[optionConfig.optionLabel] }}
<el-checkbox-group v-model="checkedList"
@change="handleCheckedChange">
<el-checkbox v-for="item in baseData[optionConfig.searchItemName]"
:label="item[optionConfig.optionId]"
:key="item[optionConfig.optionId]"
@change="handleCheckedChange">
{{ item[optionConfig.optionLabel] }}
</el-checkbox>
</el-checkbox-group>
</block>
<img
slot="reference"
class="head-search"
src="./image/search.png"
@click="handleOpen"
>
<img slot="reference"
class="head-search"
src="./image/search.png"
@click="handleOpen">
</el-popover>
</template>
<script>
import _ from 'lodash'
// import _ from 'lodash'
import { deepClone } from '@/common/util'
export default {
name: 'TableHeadSearch',
data() {
......@@ -83,7 +72,7 @@ export default {
methods: {
handleOpen() {
this.checkedList = _.cloneDeep(this.searchForm[this.optionConfig.searchItemName])
this.checkedList = deepClone(this.searchForm[this.optionConfig.searchItemName])
this.handleCheckedChange(this.checkedList)
this.$nextTick()
},
......
......@@ -9,7 +9,8 @@
:highlight-current-row="true"
@sort-change="sortChange"
@selection-change="handleSelect"
:tree-props="{children: 'upgradeGoodsList'}">
:tree-props="{children: 'upgradeGoodsList'}"
:span-method="arraySpanMethod">
<el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
type="selection"
:selectable="selectableFn"
......@@ -19,7 +20,7 @@
width="60px"
label="序号"
type="index"
:index="index=>index+(pagination.currentPage - 1) * pagination.pageSize + 1" />
:index="index=>index+((pagination.currentPage?pagination.currentPage:page.currentPage) - 1) * (pagination.pageSize?pagination.pageSize:page.pageSize) + 1" />
<el-table-column v-for="(item, index) in tableParams.tableColumns"
:key="index"
:label="item.label"
......@@ -42,6 +43,9 @@
:scope="scope.row"
:prop="item.prop"
:width="item.width" />
<template v-else-if="item.type == 'ownSerialNum'">
<span>{{scope.row[item.prop] >= 0 ? (scope.row[item.prop]+((pagination.currentPage?pagination.currentPage:page.currentPage) - 1) * (pagination.pageSize?pagination.pageSize:page.pageSize) + 1) : ''}}</span>
</template>
<template v-else-if="item.tagLabel">
<el-tag v-if="!item.tagName"
:type="tableParams.tag.type[scope.row[item.prop]]"
......@@ -231,6 +235,17 @@ export default {
type: Function,
default: null
},
// 列表数据需特殊处理
filterListData: {
type: Boolean,
default: false
},
// 合并单元格方法
arraySpanMethod: {
type: Function,
default: null
},
},
mounted() {
......@@ -289,6 +304,28 @@ export default {
// this.tableParams.needUnique && (res[this.tableParams.listName].forEach((item) => {
// item[this.tableParams.mutiSelectUniqueKey]
// }))
//
if (this.filterListData) {
res[this.tableParams.listName] && res[this.tableParams.listName].forEach((val, index) => {
let shopPriceArr = []
let stockTotal = 0
val.ownSerialNum = index
val.upgradeGoodsList && val.upgradeGoodsList.forEach(v => {
shopPriceArr.push(v.upgradePrice)
v.listShowShopPrice = v.upgradePrice
v.listShowStock = v.stock
v.listShowSpecificationData = v.specificationData
v.goodsInfo.goodsName = val.baseGoodsName
stockTotal += v.stock
})
let minPrice = shopPriceArr.length ? Math.min(...shopPriceArr) : 0
let maxPrice = shopPriceArr.length ? Math.max(...shopPriceArr) : 0
// 父商品规格数量
val.listShowSpecificationData = val.upgradeGoodsList && val.upgradeGoodsList.length > 0 ? 'X' + val.upgradeGoodsList.length : ''
val.listShowShopPrice = minPrice == maxPrice ? maxPrice : minPrice + '~' + maxPrice
val.listShowStock = stockTotal
})
}
this.data = res[this.tableParams.listName]
if (this.tableParams.needUnique) {
let temp = 1
......
import Vue from 'vue'
import Vue from "vue"
import d2Container from './d2-container'
import authButton from './d2-auth/d2-auth-btn.js'
import d2Container from "./d2-container"
import authButton from "./d2-auth/d2-auth-btn.js"
// 注意 有些组件使用异步加载会有影响
Vue.component('D2Container', d2Container)
Vue.component('D2Icon', () => import('./d2-icon'))
Vue.component('D2ElIcon', () => import('./d2-el-icon'))
Vue.component('D2IconSvg', () => import('./d2-icon-svg/index.vue'))
Vue.component('D2TableHeader', () => import('./d2-table-header/index.vue'))
Vue.component('D2Table', () => import('./d2-table/index.vue'))
Vue.component('D2Dialog', () => import('./d2-dialog/index.vue'))
Vue.component('D2Form', () => import('./d2-form/index.vue'))
Vue.component('D2Search', () => import('./d2-search/index.vue'))
Vue.component('RelateStoreDialog', () =>
import('./d2-form/relateStoreDialog.vue')
Vue.component("D2Container", d2Container)
Vue.component("D2Icon", () => import("./d2-icon"))
Vue.component("D2ElIcon", () => import("./d2-el-icon"))
Vue.component("D2IconSvg", () => import("./d2-icon-svg/index.vue"))
Vue.component("D2TableHeader", () => import("./d2-table-header/index.vue"))
Vue.component("D2Table", () => import("./d2-table/index.vue"))
Vue.component("D2Dialog", () => import("./d2-dialog/index.vue"))
Vue.component("D2Form", () => import("./d2-form/index.vue"))
Vue.component("D2Search", () => import("./d2-search/index.vue"))
Vue.component("RelateStoreDialog", () =>
import("./d2-form/relateStoreDialog.vue")
)
Vue.component('baseDialog', () => import('./baseDialog/index.vue'))
Vue.component("BaseDialog", () => import("./baseDialog/index.vue"))
// Vue.component([authButton.name], authButton)
Vue.component(authButton.name, authButton)
<template>
<div>
<div class="d2-mr personal-wrap">
<!-- <p class="bg-blue-500 text-5xl">111111</p> -->
<i class="el-icon-s-tools"
style="marginRight:20px;cursor:pointer"
v-if="userInfo.beSuper"
......
......@@ -23,14 +23,15 @@
<script>
import { getPrivacyAgreement, insertOrUpdatePrivacyAgreement } from '@api/index'
import { deepClone } from '@/common/util'
export default {
name: 'privacyAgreementDialog',
name: 'PrivacyAgreementDialog',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
infoForm: {
title: '',
module: 'PrivacyAgreement',
module: 'PrivacyAgreement'
},
// 基本数据
......@@ -67,7 +68,7 @@ export default {
var params = {}
params.module = this.infoForm.module
getPrivacyAgreement(params).then(res => {
this.infoForm.title = res ? res : ''
this.infoForm.title = res || ''
})
},
......@@ -75,7 +76,7 @@ export default {
// this.$refs.privacyForm.validate(valid => {
// if (valid) {
var params = {}
var infoForm = _.cloneDeep(this.infoForm)
var infoForm = deepClone(this.infoForm)
params = infoForm
insertOrUpdatePrivacyAgreement(params).then(res => {
this.notice.okTips()
......
import low from 'lowdb'
import LocalStorage from 'lowdb/adapters/LocalStorage'
import util from '@/libs/util'
const isDev = process.env.NODE_ENV === 'development'
const adapter = new LocalStorage(`${process.env.VUE_APP_STORAGE_PREFIX}-${process.env.VUE_APP_VERSION}`, {
serialize: (data) => isDev ? JSON.stringify(data) : escape(JSON.stringify(data)),
deserialize: (data) => isDev ? JSON.parse(data) : JSON.parse(unescape(data))
})
const db = low(adapter)
db
.defaults({
sys: {},
database: {}
})
.write()
export default db
/**
* @description 检查路径是否存在 不存在的话初始化
* @param {Object} payload dbName {String} 数据库名称
* @param {Object} payload path {String} 路径
* @param {Object} payload user {Boolean} 区分用户
* @param {Object} payload validator {Function} 数据校验钩子 返回 true 表示验证通过
* @param {Object} payload defaultValue {*} 初始化默认值
* @returns {String} 可以直接使用的路径
*/
export function pathInit({
dbName = 'database',
path = '',
user = true,
validator = () => true,
defaultValue = ''
}) {
const uuid = util.cookies.get('uuid') || 'ghost-uuid'
const currentPath = `${dbName}.${user ? `user.${uuid}` : 'public'}${path ? `.${path}` : ''}`
const value = db.get(currentPath).value()
if (!(value !== undefined && validator(value))) {
db
.set(currentPath, defaultValue)
.write()
}
return currentPath
}
/**
* @description 将数据存储到指定位置 | 路径不存在会自动初始化
* @description 效果类似于取值 dbName.path = value
* @param {Object} payload dbName {String} 数据库名称
* @param {Object} payload path {String} 存储路径
* @param {Object} payload value {*} 需要存储的值
* @param {Object} payload user {Boolean} 是否区分用户
*/
export function dbSet({
dbName = 'database',
path = '',
value = '',
user = false
}) {
db.set(pathInit({
dbName,
path,
user
}), value).write()
}
/**
* @description 获取数据
* @description 效果类似于取值 dbName.path || defaultValue
* @param {Object} payload dbName {String} 数据库名称
* @param {Object} payload path {String} 存储路径
* @param {Object} payload defaultValue {*} 取值失败的默认值
* @param {Object} payload user {Boolean} 是否区分用户
*/
export function dbGet({
dbName = 'database',
path = '',
defaultValue = '',
user = false
}) {
return new Promise(resolve => {
resolve(_.cloneDeep(db.get(pathInit({
dbName,
path,
user,
defaultValue
})).value()))
})
}
/**
* @description 获取存储数据库对象
* @param {Object} payload user {Boolean} 是否区分用户
*/
export function database({
dbName = 'database',
path = '',
user = false,
validator = () => true,
defaultValue = ''
} = {}) {
return new Promise(resolve => {
resolve(db.get(pathInit({
dbName, path, user, validator, defaultValue
})))
})
}
import low from "lowdb"
import LocalStorage from "lowdb/adapters/LocalStorage"
import util from "@/libs/util"
import { deepClone } from "@/common/util"
const isDev = process.env.NODE_ENV === "development"
const adapter = new LocalStorage(
`${process.env.VUE_APP_STORAGE_PREFIX}-${process.env.VUE_APP_VERSION}`,
{
serialize: (data) =>
isDev ? JSON.stringify(data) : escape(JSON.stringify(data)),
deserialize: (data) =>
isDev ? JSON.parse(data) : JSON.parse(unescape(data))
}
)
const db = low(adapter)
db.defaults({
sys: {},
database: {}
}).write()
export default db
/**
* @description 检查路径是否存在 不存在的话初始化
* @param {Object} payload dbName {String} 数据库名称
* @param {Object} payload path {String} 路径
* @param {Object} payload user {Boolean} 区分用户
* @param {Object} payload validator {Function} 数据校验钩子 返回 true 表示验证通过
* @param {Object} payload defaultValue {*} 初始化默认值
* @returns {String} 可以直接使用的路径
*/
export function pathInit({
dbName = "database",
path = "",
user = true,
validator = () => true,
defaultValue = ""
}) {
const uuid = util.cookies.get("uuid") || "ghost-uuid"
const currentPath = `${dbName}.${user ? `user.${uuid}` : "public"}${
path ? `.${path}` : ""
}`
const value = db.get(currentPath).value()
if (!(value !== undefined && validator(value))) {
db.set(currentPath, defaultValue).write()
}
return currentPath
}
/**
* @description 将数据存储到指定位置 | 路径不存在会自动初始化
* @description 效果类似于取值 dbName.path = value
* @param {Object} payload dbName {String} 数据库名称
* @param {Object} payload path {String} 存储路径
* @param {Object} payload value {*} 需要存储的值
* @param {Object} payload user {Boolean} 是否区分用户
*/
export function dbSet({
dbName = "database",
path = "",
value = "",
user = false
}) {
db.set(
pathInit({
dbName,
path,
user
}),
value
).write()
}
/**
* @description 获取数据
* @description 效果类似于取值 dbName.path || defaultValue
* @param {Object} payload dbName {String} 数据库名称
* @param {Object} payload path {String} 存储路径
* @param {Object} payload defaultValue {*} 取值失败的默认值
* @param {Object} payload user {Boolean} 是否区分用户
*/
export function dbGet({
dbName = "database",
path = "",
defaultValue = "",
user = false
}) {
return new Promise((resolve) => {
resolve(
deepClone(
db
.get(
pathInit({
dbName,
path,
user,
defaultValue
})
)
.value()
)
)
})
}
/**
* @description 获取存储数据库对象
* @param {Object} payload user {Boolean} 是否区分用户
*/
export function database({
dbName = "database",
path = "",
user = false,
validator = () => true,
defaultValue = ""
} = {}) {
return new Promise((resolve) => {
resolve(
db.get(
pathInit({
dbName,
path,
user,
validator,
defaultValue
})
)
)
})
}
......@@ -4,35 +4,41 @@
* @Last Modified by: chenwq
* @Last Modified time: 2020-12-18 12:56:39
*/
import { deepClone } from "@/common/util"
const permision = {}
/**
* 打包如有与按钮
* resources 所有资源集合
* idsInPermision 返回的权限id集合
*/
permision.packRoutesBtns = function(resources, idsInPermision) {
permision.packRoutesBtns = function (resources, idsInPermision) {
if (!resources || !idsInPermision || !idsInPermision.length) {
throw new Error('参数错误')
throw new Error("参数错误")
}
const __aRouteInPermision = []
const __oBtnInPermision = {}
let __objResource = null
let __obj = null
idsInPermision.forEach(obj => {
idsInPermision.forEach((obj) => {
__objResource = resources[obj.authId]
if (__objResource) { // 直接能取到的为路由 (也可以在routes 中定标识变量)
if (__objResource) {
// 直接能取到的为路由 (也可以在routes 中定标识变量)
__aRouteInPermision.push(resources[obj.authId]) // push 进 路由数组
} else { // 如果取不到 判断是否有父节点 并且父节点是否有auth属性 有 则视为按钮 (同样可以定义标识变量)
} else {
// 如果取不到 判断是否有父节点 并且父节点是否有auth属性 有 则视为按钮 (同样可以定义标识变量)
__objResource = resources[obj.parentId]
if (__objResource && __objResource.auth) {
__obj = __objResource.auth.find(o => +o.authId === +obj.authId)
if (__oBtnInPermision[obj.parentId] && __oBtnInPermision[obj.parentId].length) {
__obj = __objResource.auth.find((o) => +o.authId === +obj.authId)
if (
__oBtnInPermision[obj.parentId] &&
__oBtnInPermision[obj.parentId].length
) {
__oBtnInPermision[obj.parentId].push(__obj)
} else {
__oBtnInPermision[obj.parentId] = [__obj]
}
// __oBtnInPermision[obj.parentId] = __objResource.auth
// __aBtnIdAll = __aBtnIdAll.concat([...__objResource.auth.action.map(o=>o.authId),...__objResource.auth.operation.map(o=>o.authId)])
// __oBtnInPermision[obj.parentId] = __objResource.auth
// __aBtnIdAll = __aBtnIdAll.concat([...__objResource.auth.action.map(o=>o.authId),...__objResource.auth.operation.map(o=>o.authId)])
}
}
})
......@@ -47,11 +53,13 @@ permision.packRoutesBtns = function(resources, idsInPermision) {
* resources 所有资源集合
* idsInPermision 返回的权限id集合
*/
permision.packAsideMenus = function(resources, idsInPermision) {
permision.packAsideMenus = function (resources, idsInPermision) {
if (!resources || !idsInPermision || !idsInPermision.length) {
throw new Error('参数错误')
throw new Error("参数错误")
}
return _loop(idsInPermision, obj => permision.format2Menu(resources[obj.authId]))
return _loop(idsInPermision, (obj) =>
permision.format2Menu(resources[obj.authId])
)
}
/**
......@@ -59,37 +67,40 @@ permision.packAsideMenus = function(resources, idsInPermision) {
* resources 所有资源集合
* idsInPermision 返回的权限id集合
*/
permision.packMenusBtns = function(resources) {
permision.packMenusBtns = function (resources) {
if (!resources) {
throw new Error('参数错误')
throw new Error("参数错误")
}
const menus = _loop(resources, obj => permision.format2ResourceMenu(obj))
const menus = _loop(resources, (obj) => permision.format2ResourceMenu(obj))
return { menus, all: [] }
}
const _loop = function(res, fnGetMenu) {
const _loop = function (res, fnGetMenu) {
const __aParent = []
const __aSub = []
/**
* 第一次循环 分出一级菜单与所有子菜单
*/
res.forEach(obj => {
res.forEach((obj) => {
const __oMenu = fnGetMenu(obj)
if (!__oMenu) { // 不存在 可能是 按钮 直接继续循环
if (!__oMenu) {
// 不存在 可能是 按钮 直接继续循环
return true
}
if (+(__oMenu.parentId) === 1) { // 取出1级菜单
if (+__oMenu.parentId === 1) {
// 取出1级菜单
__aParent.push(__oMenu)
} else { // 取出子菜单
} else {
// 取出子菜单
__aSub.push(__oMenu)
}
})
/**
* 第二次循环所有子菜单 ,然后挂载到对应的一级菜单
*/
* 第二次循环所有子菜单 ,然后挂载到对应的一级菜单
*/
let __parent = null
__aSub.forEach(obj => {
__parent = __aParent.find(menu => +(menu.authId) === +(obj.parentId))
__aSub.forEach((obj) => {
__parent = __aParent.find((menu) => +menu.authId === +obj.parentId)
if (__parent) {
if (__parent.children) {
__parent.children.push(obj)
......@@ -104,7 +115,7 @@ const _loop = function(res, fnGetMenu) {
/**
* 格式化菜单 封装成系统所需格式
*/
permision.format2Menu = function(oMenu) {
permision.format2Menu = function (oMenu) {
if (!oMenu) return null
const { icon, path, meta } = oMenu
const { title, authId, parentId, sideHidden } = meta
......@@ -114,14 +125,14 @@ permision.format2Menu = function(oMenu) {
path,
authId,
parentId,
sideHidden
sideHidden
}
}
/**
* 格式化菜单 封装成系统所需格式
*/
permision.format2ResourceMenu = function(oMenu) {
permision.format2ResourceMenu = function (oMenu) {
if (!oMenu) return null
const { icon, meta, auth } = oMenu
const { title, authId, parentId } = meta
......@@ -130,20 +141,22 @@ permision.format2ResourceMenu = function(oMenu) {
icon,
authId,
parentId,
auth
auth
}
}
/**
* 扁平化 routes (@/router/routes)
*/
permision.flatten = function(arr) {
permision.flatten = function (arr) {
return arr.reduce((result, item) => {
item.authId = item.authId || item.meta.authId
item.parentId = item.parentId || item.meta.parentId
const cloneItem = _.cloneDeep(item)
const cloneItem = deepClone(item)
delete cloneItem.auth
return result.concat(item.auth ? permision.flatten([...item.auth, cloneItem]) : item)
return result.concat(
item.auth ? permision.flatten([...item.auth, cloneItem]) : item
)
}, [])
}
export default permision
......@@ -25,10 +25,6 @@ import "element-ui/lib/theme-chalk/index.css"
// import ElementUI from 'element-ui'
// Vue.use(ElementUI)
// import menuHeader from '@/menu/header'
// import menuAside from '@/menu/aside'
// import { frameInRoutes } from '@/router/routes'
// 核心插件
Vue.use(d2Admin)
Vue.use(chaining)
......@@ -82,11 +78,9 @@ fetch(
}
)
.then((response) => {
// console.log(response)
const { code, data } = response
// console.log(aahph)
// console.log(response)
code == "200" && (baseConfig = data)
// console.log('data', data)
new Vue({
router,
store,
......@@ -97,16 +91,6 @@ fetch(
Vue.prototype.baseConfig = data
return h(App)
},
// created () {
// 处理路由 得到每一级的路由设置
// this.$store.commit('d2admin/page/init', frameInRoutes)
// 设置顶栏菜单 (暂时不需要)
// this.$store.commit('d2admin/menu/headerSet', menuHeader)
// 设置侧边栏菜单 (TODO 进行过滤)
// this.$store.commit('d2admin/menu/asideSet', menuAside)
// 初始化菜单搜索功能
// this.$store.commit('d2admin/search/init', menuHeader)
// },
created() {
// 系统配置
Vue.config.devtools = true
......@@ -123,62 +107,4 @@ fetch(
}).$mount("#app")
})
// axios({
// // baseURL: process.env.VUE_APP_REPO + '/dj-car-life-system-config-test',
// // baseURL: process.env.VUE_APP_REPO + '/dj-car-life-system-config',
// baseURL:
// 'http://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config',
// method: 'get'
// // }).then(({ data }) => {
// }).then(({ data }) => {
// // console.log(data)
// // let {data} = res
// console.log(data)
// baseConfig = data
// // 新配置中心写法
// const { data: config, code } = data
// code == '200' && (baseConfig = config)
// // console.log(data)
// // // debugger
// console.log(baseConfig)
// // baseConfig = data.data
// // 先本地切换到测试环境接口
// // data.axios.baseURL = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// new Vue({
// router,
// store,
// // i18n,
// render: h => {
// // data.axios.baseURL =
// // 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// Vue.prototype.baseConfig = data
// return h(App)
// },
// // created () {
// // 处理路由 得到每一级的路由设置
// // this.$store.commit('d2admin/page/init', frameInRoutes)
// // 设置顶栏菜单 (暂时不需要)
// // this.$store.commit('d2admin/menu/headerSet', menuHeader)
// // 设置侧边栏菜单 (TODO 进行过滤)
// // this.$store.commit('d2admin/menu/asideSet', menuAside)
// // 初始化菜单搜索功能
// // this.$store.commit('d2admin/search/init', menuHeader)
// // },
// created() {
// // 系统配置
// Vue.config.devtools = true
// // 展示系统信息
// this.$store.commit('d2admin/releases/versionShow')
// // 用户登录后从数据库加载一系列的设置
// this.$store.dispatch('d2admin/account/load')
// // 获取并记录用户 UA
// this.$store.commit('d2admin/ua/get')
// // 初始化全屏监听
// this.$store.dispatch('d2admin/fullscreen/listen')
// },
// mounted() {}
// }).$mount('#app')
// })
export { baseConfig }
......@@ -7,10 +7,19 @@ const chaining = {
const name = rest[key]
tmp = tmp?.[name]
}
return tmp || ''
return tmp || ""
}
// const test = (obj, ...rest) => {
// let tmp = obj
// for (const key in rest) {
// const name = rest[key]
// tmp = tmp?.[name]
// }
// return tmp || ''
// }
// 添加实例方法
vue.prototype.$$ = optionalChaining
// vue.prototype.$sy = test
}
}
......
......@@ -82,6 +82,7 @@ export const sys = [
* 905 - 财务管理
* 906 - 系统设置
* 908 - 我的分账
* 909 - 活动管理
*/
export const resources = {
90703: {
......@@ -287,7 +288,7 @@ export const resources = {
path: "/goods",
name: "goods",
meta: {
title: "产品管理",
title: "商品库",
authId: "903",
parentId: "1",
cache: false
......@@ -371,7 +372,7 @@ export const resources = {
path: "/commodity",
name: "commodity",
meta: {
title: "零售商品",
title: "商品管理",
authId: "90302",
parentId: "903",
cache: false
......@@ -801,11 +802,19 @@ export const resources = {
label: "历史记录",
handle: "handleRecord"
},
// {
// authId: "9060305",
// parentId: "90603",
// label: "删除",
// handle: "handleDelete"
// },
{
authId: "9060305",
authId: "9060307",
parentId: "90603",
label: "删除",
handle: "handleDelete"
label: "商户关联",
category: "Button",
type: "primary",
handle: "handleMerchantRelate"
}
],
component: _import("systemConfig/merchant/merchantManage")
......@@ -993,6 +1002,45 @@ export const resources = {
activePath: "/accountList_new"
},
component: _import("systemConfig/accountNew/applyAccount")
},
90612: {
path: "/sceneCategoryManage",
name: "sceneCategoryManage",
meta: {
title: "场景&类目管理",
authId: "90612",
parentId: "906",
cache: false
},
auth: [
{
authId: "9061201",
parentId: "90612",
label: "关联类目",
handle: "relationCategory"
},
{
authId: "9061202",
parentId: "90612",
label: "新增类目",
category: "Button",
type: "primary",
handle: "addCategory"
},
{
authId: "9061203",
parentId: "90612",
label: "编辑",
handle: "editCategory"
},
{
authId: "9061204",
parentId: "90612",
label: "删除",
handle: "deleteCategory"
}
],
component: _import("systemConfig/sceneCategoryManage/index")
}
// '90602': {
// path: '/serviceStore',
......
import router from '@/router'
import { database as getDatabase, dbGet, dbSet } from '@/libs/util.db'
export default {
namespaced: true,
actions: {
/**
* @description 将数据存储到指定位置 | 路径不存在会自动初始化
* @description 效果类似于取值 dbName.path = value
* @param {Object} context
* @param {Object} payload dbName {String} 数据库名称
* @param {Object} payload path {String} 存储路径
* @param {Object} payload value {*} 需要存储的值
* @param {Object} payload user {Boolean} 是否区分用户
*/
set(context, {
dbName = 'database',
path = '',
value = '',
user = false
}) {
dbSet({ dbName, path, value, user })
},
/**
* @description 获取数据
* @description 效果类似于取值 dbName.path || defaultValue
* @param {Object} context
* @param {Object} payload dbName {String} 数据库名称
* @param {Object} payload path {String} 存储路径
* @param {Object} payload defaultValue {*} 取值失败的默认值
* @param {Object} payload user {Boolean} 是否区分用户
*/
get(context, {
dbName = 'database',
path = '',
defaultValue = '',
user = false
}) {
return dbGet({ dbName, path, defaultValue, user })
},
/**
* @description 获取存储数据库对象
* @param {Object} context
* @param {Object} payload user {Boolean} 是否区分用户
*/
database(context, {
user = false
} = {}) {
return getDatabase({
user,
defaultValue: {}
})
},
/**
* @description 清空存储数据库对象
* @param {Object} context
* @param {Object} payload user {Boolean} 是否区分用户
*/
databaseClear(context, {
user = false
} = {}) {
return getDatabase({
user,
validator: () => false,
defaultValue: {}
})
},
/**
* @description 获取存储数据库对象 [ 区分页面 ]
* @param {Object} context
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
* @param {Object} payload user {Boolean} 是否区分用户
*/
databasePage(context, {
basis = 'fullPath',
user = false
} = {}) {
return getDatabase({
path: `$page.${router.app.$route[basis]}`,
user,
defaultValue: {}
})
},
/**
* @description 清空存储数据库对象 [ 区分页面 ]
* @param {Object} context
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
* @param {Object} payload user {Boolean} 是否区分用户
*/
databasePageClear(context, {
basis = 'fullPath',
user = false
} = {}) {
return getDatabase({
path: `$page.${router.app.$route[basis]}`,
user,
validator: () => false,
defaultValue: {}
})
},
/**
* @description 快速将页面当前的数据 ( $data ) 持久化
* @param {Object} context
* @param {Object} payload instance {Object} vue 实例
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
* @param {Object} payload user {Boolean} 是否区分用户
*/
pageSet(context, {
instance,
basis = 'fullPath',
user = false
}) {
return getDatabase({
path: `$page.${router.app.$route[basis]}.$data`,
user,
validator: () => false,
defaultValue: _.cloneDeep(instance.$data)
})
},
/**
* @description 快速获取页面快速持久化的数据
* @param {Object} context
* @param {Object} payload instance {Object} vue 实例
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
* @param {Object} payload user {Boolean} 是否区分用户
*/
pageGet(context, {
instance,
basis = 'fullPath',
user = false
}) {
return dbGet({
path: `$page.${router.app.$route[basis]}.$data`,
user,
defaultValue: _.cloneDeep(instance.$data)
})
},
/**
* @description 清空页面快照
* @param {Object} context
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
* @param {Object} payload user {Boolean} 是否区分用户
*/
pageClear(context, {
basis = 'fullPath',
user = false
}) {
return getDatabase({
path: `$page.${router.app.$route[basis]}.$data`,
user,
validator: () => false,
defaultValue: {}
})
}
}
}
import router from "@/router"
import { database as getDatabase, dbGet, dbSet } from "@/libs/util.db"
import { deepClone } from "@/common/util"
export default {
namespaced: true,
actions: {
/**
* @description 将数据存储到指定位置 | 路径不存在会自动初始化
* @description 效果类似于取值 dbName.path = value
* @param {Object} context
* @param {Object} payload dbName {String} 数据库名称
* @param {Object} payload path {String} 存储路径
* @param {Object} payload value {*} 需要存储的值
* @param {Object} payload user {Boolean} 是否区分用户
*/
set(context, { dbName = "database", path = "", value = "", user = false }) {
dbSet({ dbName, path, value, user })
},
/**
* @description 获取数据
* @description 效果类似于取值 dbName.path || defaultValue
* @param {Object} context
* @param {Object} payload dbName {String} 数据库名称
* @param {Object} payload path {String} 存储路径
* @param {Object} payload defaultValue {*} 取值失败的默认值
* @param {Object} payload user {Boolean} 是否区分用户
*/
get(
context,
{ dbName = "database", path = "", defaultValue = "", user = false }
) {
return dbGet({ dbName, path, defaultValue, user })
},
/**
* @description 获取存储数据库对象
* @param {Object} context
* @param {Object} payload user {Boolean} 是否区分用户
*/
database(context, { user = false } = {}) {
return getDatabase({
user,
defaultValue: {}
})
},
/**
* @description 清空存储数据库对象
* @param {Object} context
* @param {Object} payload user {Boolean} 是否区分用户
*/
databaseClear(context, { user = false } = {}) {
return getDatabase({
user,
validator: () => false,
defaultValue: {}
})
},
/**
* @description 获取存储数据库对象 [ 区分页面 ]
* @param {Object} context
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
* @param {Object} payload user {Boolean} 是否区分用户
*/
databasePage(context, { basis = "fullPath", user = false } = {}) {
return getDatabase({
path: `$page.${router.app.$route[basis]}`,
user,
defaultValue: {}
})
},
/**
* @description 清空存储数据库对象 [ 区分页面 ]
* @param {Object} context
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
* @param {Object} payload user {Boolean} 是否区分用户
*/
databasePageClear(context, { basis = "fullPath", user = false } = {}) {
return getDatabase({
path: `$page.${router.app.$route[basis]}`,
user,
validator: () => false,
defaultValue: {}
})
},
/**
* @description 快速将页面当前的数据 ( $data ) 持久化
* @param {Object} context
* @param {Object} payload instance {Object} vue 实例
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
* @param {Object} payload user {Boolean} 是否区分用户
*/
pageSet(context, { instance, basis = "fullPath", user = false }) {
return getDatabase({
path: `$page.${router.app.$route[basis]}.$data`,
user,
validator: () => false,
defaultValue: deepClone(instance.$data)
})
},
/**
* @description 快速获取页面快速持久化的数据
* @param {Object} context
* @param {Object} payload instance {Object} vue 实例
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
* @param {Object} payload user {Boolean} 是否区分用户
*/
pageGet(context, { instance, basis = "fullPath", user = false }) {
return dbGet({
path: `$page.${router.app.$route[basis]}.$data`,
user,
defaultValue: deepClone(instance.$data)
})
},
/**
* @description 清空页面快照
* @param {Object} context
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
* @param {Object} payload user {Boolean} 是否区分用户
*/
pageClear(context, { basis = "fullPath", user = false }) {
return getDatabase({
path: `$page.${router.app.$route[basis]}.$data`,
user,
validator: () => false,
defaultValue: {}
})
}
}
}
export default {
namespaced: true,
state: {
// 列表搜索框状态
active: true
},
mutations: {
/**
* @description 切换状态
* @param {Object} state state
*/
toggle(state) {
state.active = !state.active
},
/**
* @description 设置搜索框状态
* @param {Object} state state
* @param {Boolean} active active
*/
set(state, active) {
state.active = active
}
},
actions: {
reset({ state }) {
state.active = true
}
}
}
......@@ -22,99 +22,77 @@
@click="handleCash"
>提现></el-button>
</div> -->
<div
class="header"
slot="header"
>
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData"
>
<div
slot="accountType"
style="display: flex; justify-content: space-between;"
>
<el-select
v-model="searchForm.divisionType"
@change="handleAccTypeChange"
>
<el-option
v-for="item in baseData.divisionTypeList"
:key="item.confId"
:value="item.confId"
:label="item.confLabel"
/>
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData">
<div slot="accountType"
style="display: flex; justify-content: space-between;">
<el-select v-model="searchForm.divisionType"
@change="handleAccTypeChange">
<el-option v-for="item in baseData.divisionTypeList"
:key="item.confId"
:value="item.confId"
:label="item.confLabel" />
</el-select>
<el-select v-model="searchForm.divisionStatus">
<el-option
v-for="item in (searchForm.divisionType === '2') ? baseData.divisionStatusList : [{ confId: '', confLabel: '全部' }]"
:key="item.confId"
:value="item.confId"
:label="item.confLabel"
/>
<el-option v-for="item in (searchForm.divisionType === '2') ? baseData.divisionStatusList : [{ confId: '', confLabel: '全部' }]"
:key="item.confId"
:value="item.confId"
:label="item.confLabel" />
</el-select>
</div>
</d2-search>
<div class="up-btns">
<el-button
:id="tableParams.btnId"
size="small"
type="primary"
>
查询
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
<el-button
size="small"
@click="handleReset"
>
重置
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header :left-span="22">
<span slot="left">共<span class="count-txt">{{ countObj.orderCount }}</span>笔订单,累计分账金额<span class="count-txt">{{ countObj.partnerDivisionMoneyCount }}</span>元,分账成功金额<span class="count-txt">{{ countObj.partnerDivisionSuccessMoneyCount }}</span>元,分账中金额<span class="count-txt">{{ countObj.partnerInDivisionMoneyCount }}</span>元,分账失败金额<span class="count-txt">{{ countObj.partnerDivisionFailureMoneyCount }}</span>元。</span>
<el-button
type="primary"
size="mini"
@click="handleExport"
>
导出
<span slot="left">共<span class="count-txt">{{ countObj.orderCount }}</span>笔订单,累计分账金额<span
class="count-txt">{{ countObj.partnerDivisionMoneyCount }}</span>元,分账成功金额<span
class="count-txt">{{ countObj.partnerDivisionSuccessMoneyCount }}</span>元,分账中金额<span
class="count-txt">{{ countObj.partnerInDivisionMoneyCount }}</span>元,分账失败金额<span
class="count-txt">{{ countObj.partnerDivisionFailureMoneyCount }}</span>元。</span>
<el-button type="primary"
size="mini"
@click="handleExport">
导出
</el-button>
</d2-table-header>
<d2-table
ref="merchantTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<template
slot="divisionStatus"
slot-scope="scope"
>
<span
v-if="scope.scope.divisionStatus"
:style="{ 'color': [4, 5].includes(+scope.scope.divisionStatus) ? 'red' : '#606266' }"
>{{ baseData.divisionStatusList.find(item => +item.confId === scope.scope.divisionStatus).confLabel }}</span>
<d2-table ref="merchantTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn">
<template slot="divisionStatus"
slot-scope="scope">
<span v-if="scope.scope.divisionStatus"
:style="{ 'color': [4, 5].includes(+scope.scope.divisionStatus) ? 'red' : '#606266' }">{{ baseData.divisionStatusList.find(item => +item.confId === scope.scope.divisionStatus).confLabel }}</span>
<span v-else>-</span>
</template>
</d2-table>
</div>
<cash-dialog
:cash-form="cashForm"
:cash-visible="cashVisible"
@handleCashConfirm="handleCashConfirm"
@handleCashClose="handleCashClose"
/>
<cash-dialog :cash-form="cashForm"
:cash-visible="cashVisible"
@handleCashConfirm="handleCashConfirm"
@handleCashClose="handleCashClose" />
</d2-container>
</template>
<script>
import { mapActions } from 'vuex'
import { Util } from '@/common/util'
import { Util, deepClone } from '@/common/util'
import cashDialog from './cashDialog'
import { getCurrentSixMonth, divisionTypeList, divisionStatusList } from '@/common/constants.js'
// import { getPartnerYqListApi } from '@api/editCustomer'
......@@ -204,7 +182,7 @@ export default {
baseData: {
parkServiceList: [],
divisionStatusList: [],
divisionTypeList: _.cloneDeep(divisionTypeList)
divisionTypeList: deepClone(divisionTypeList)
}
}
},
......@@ -216,7 +194,7 @@ export default {
mounted() {
this.getCount()
// this.getBankBalance()
this.baseData.divisionStatusList = _.cloneDeep(divisionStatusList)
this.baseData.divisionStatusList = deepClone(divisionStatusList)
this.baseData.divisionStatusList.unshift({
confId: '',
confLabel: '全部'
......@@ -241,7 +219,7 @@ export default {
},
getParams() {
var params = _.cloneDeep(this.searchForm)
var params = deepClone(this.searchForm)
if (params.divisionDate && params.divisionDate.length) {
params.divisionStartDate = Util.dateFormate(this.getMouthLastDate(params.divisionDate[0]), 'YYYY-MM-DD')
params.divisionEndDate = Util.dateFormate(this.getMouthLastDate(params.divisionDate[1]), 'YYYY-MM-DD')
......@@ -305,7 +283,7 @@ export default {
// 提现弹窗
handleCash() {
this.handleCashClose()
Object.assign(this.cashForm, _.cloneDeep(this.withdrawBalanceInfo))
Object.assign(this.cashForm, deepClone(this.withdrawBalanceInfo))
},
handleCashClose() {
this.cashVisible = !this.cashVisible
......
<!-- 我的分账-提现记录 -->
<template>
<d2-container class="my-account-record">
<div
class="header"
slot="header"
>
<d2-search
ref="showSearch"
:search-form="searchForm"
:form-data="showFormData"
/>
<div class="header"
slot="header">
<d2-search ref="showSearch"
:search-form="searchForm"
:form-data="showFormData" />
<div class="up-btns">
<el-button
:id="tableParams.btnId"
size="small"
type="primary"
>
查询
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
<el-button
size="small"
@click="handleReset"
>
重置
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header :left-span="24">
<span slot="left">共提现<span class="count-txt">{{ countObj.recordCount }}</span>次,累计分账金额<span class="count-txt">{{ countObj.totalAmount }}</span>元。</span>
<span slot="left">共提现<span class="count-txt">{{ countObj.recordCount }}</span>次,累计分账金额<span
class="count-txt">{{ countObj.totalAmount }}</span>元。</span>
</d2-table-header>
<d2-table
ref="merchantTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
/>
<d2-table ref="merchantTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn" />
</div>
</d2-container>
</template>
<script>
import { Util } from '@/common/util'
import { Util, deepClone } from '@/common/util'
import { getWithdrawList, getWithdrawCountApi } from '@/api/account'
import { getCurrentSixMonth, withdrawStatusList, withdrawChannelList } from '@/common/constants.js'
export default {
......@@ -171,7 +162,7 @@ export default {
},
getParams() {
var params = _.cloneDeep(this.searchForm)
var params = deepClone(this.searchForm)
if (params.withDrawDate && params.withDrawDate.length) {
params.startDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[0]), 'YYYY-MM-DD')
params.endDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[1]), 'YYYY-MM-DD')
......
......@@ -283,9 +283,10 @@
</template>
<script>
import _ from 'lodash'
import { Util } from '@/common/util'
import util from '@/libs/util'
// import _ from 'lodash'
// import { deepClone } from '@/common/util'
import { Util, deepClone } from '@/common/util'
// import util from '@/libs/util'
import { getServiceStore, getParkStore, getStaff, getCarInfo, getGoods, addOrder, editOrder } from '@api/editCustomer'
import { BaseData } from '@/common/constants.js'
import { mapActions } from 'vuex'
......@@ -314,6 +315,7 @@ export default {
callback()
}
return {
parkServiceList: [],
userInfo: this.$store.state.d2admin.user.info,
key: new Date(),
isDisabled: false,
......@@ -405,7 +407,7 @@ export default {
this.getServiceStore(this.userInfo.detail.merchantId)
}
if (this.addOrEdit === 'edit') {
this.form = _.cloneDeep(this.$route.params.form)
this.form = deepClone(this.$route.params.form)
this.isDisabled = (this.form.operStatus !== 1)
this.form.customerSex = this.form.customerSex ? (this.form.customerSex + '') : ''
this.userInfo.beSuper && (this.form.sellerMerchantId = this.form.yqMerchantId)
......
......@@ -110,7 +110,8 @@
</template>
<script>
import _ from 'lodash'
// import _ from 'lodash'
import { deepClone } from '@/common/util'
import { mapActions } from 'vuex'
import { getList, getOrderDetail, recordUpload, getOrderTotal } from '@api/recordList'
import { getServiceStore, getParkStore, getStaff, getGoods } from '@api/editCustomer'
......@@ -256,7 +257,7 @@ export default {
// label: '手机号码',
// prop: 'customerPhone',
// width: '100px'
// },
// },
{
label: '品牌车型',
prop: 'carTypeStr',
......@@ -265,7 +266,7 @@ export default {
// {
// label: '车架号',
// prop: 'standNo'
// },
// },
{
label: '钥匙号',
prop: 'carKeyNo'
......@@ -321,7 +322,7 @@ export default {
...mapActions({ close: 'd2admin/page/close' }),
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = _.cloneDeep(this.searchForm)
this.tableSearchForm = deepClone(this.searchForm)
!this.userInfo.beSuper && (this.tableSearchForm.yqMerchantId = this.userInfo.detail.merchantId)
if (this.tableSearchForm.entryTime) {
this.tableSearchForm.startDate = new Date(this.tableSearchForm.entryTime[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
......
<!-- 提现记录 -->
<template>
<d2-container class="account-record">
<div
class="header"
slot="header"
>
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData"
/>
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData" />
<div class="up-btns">
<el-button
:id="tableParams.btnId"
size="small"
type="primary"
>
查询
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
<el-button
size="small"
@click="handleReset"
>
重置
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header :left-span="24">
<span slot="left">共提现<span class="count-txt">{{ countObj.recordCount }}</span>次,累计分账金额<span class="count-txt">{{ countObj.totalAmount }}</span>元。</span>
<span slot="left">共提现<span class="count-txt">{{ countObj.recordCount }}</span>次,累计分账金额<span
class="count-txt">{{ countObj.totalAmount }}</span>元。</span>
</d2-table-header>
<d2-table
ref="accountRecordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<auth-button
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
/>
<d2-table ref="accountRecordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn">
<auth-button slot="auth-button"
slot-scope="scope"
:data="scope.scope" />
</d2-table>
</div>
</d2-container>
</template>
<script>
import { Util } from '@/common/util'
import { Util, deepClone } from '@/common/util'
import { mapActions } from 'vuex'
import { BaseData, getCurrentSixMonth, withdrawStatusList, withdrawChannelList } from '@/common/constants.js'
import { getWithdrawList, getWithdrawCountApi } from '@/api/account'
......@@ -210,7 +199,7 @@ export default {
},
getParams() {
var params = _.cloneDeep(this.searchForm)
var params = deepClone(this.searchForm)
if (params.withDrawDate && params.withDrawDate.length) {
params.startDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[0]), 'YYYY-MM-DD')
params.endDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[1]), 'YYYY-MM-DD')
......
......@@ -160,15 +160,15 @@
</template>
<script>
import _ from 'lodash'
import { Util } from '@/common/util'
// import _ from 'lodash'
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { getParkStore } from '@api/editCustomer'
// exportApi
import { getListApi, getCountApi } from '@/api/account'
import { getPlatformMerchantList } from '@api/index'
import { orderTypeList } from '@/common/constants.js'
import { asyncExportExcel } from '@api/sys.base'
// import { asyncExportExcel } from '@api/sys.base'
export default {
name: 'OfflineAccountList',
data() {
......@@ -245,7 +245,7 @@ export default {
total: 0,
baseData: {
parkServiceList: [],
orderTypeList: _.cloneDeep(orderTypeList),
orderTypeList: deepClone(orderTypeList),
PlatformMerchantList: []
}
}
......@@ -313,7 +313,7 @@ export default {
},
getParams() {
var params = _.cloneDeep(this.searchForm)
var params = deepClone(this.searchForm)
const tempParams = this.getSelectInputParams()
params = {
...params,
......
......@@ -179,14 +179,15 @@
<script>
// exportApi
import _ from 'lodash'
import { Util } from '@/common/util'
// import _ from 'lodash'
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { getParkStore } from '@api/editCustomer'
import { divisionStatusList, orderTypeList } from '@/common/constants.js'
import { getListApi, getCountApi } from '@/api/account'
import { getPlatformMerchantList } from '@api/index'
import { asyncExportExcel } from '@api/sys.base'
// import { asyncExportExcel } from '@api/sys.base'
export default {
name: 'OnlineAccountList',
data() {
......@@ -293,8 +294,8 @@ export default {
total: 0,
baseData: {
parkServiceList: [],
divisionStatusList: _.cloneDeep(divisionStatusList),
orderTypeList: _.cloneDeep(orderTypeList),
divisionStatusList: deepClone(divisionStatusList),
orderTypeList: deepClone(orderTypeList),
PlatformMerchantList: []
}
}
......@@ -363,7 +364,7 @@ export default {
},
getParams() {
var params = _.cloneDeep(this.searchForm)
var params = deepClone(this.searchForm)
const tempParams = this.getSelectInputParams()
// console.log(tempParams)
params = {
......
<!-- 我的分账-提现记录 -->
<template>
<d2-container class="my-account-record">
<div
class="header"
slot="header"
>
<d2-search
ref="showSearch"
:search-form="searchForm"
:form-data="showFormData"
/>
<div class="header"
slot="header">
<d2-search ref="showSearch"
:search-form="searchForm"
:form-data="showFormData" />
<div class="up-btns">
<el-button
:id="tableParams.btnId"
size="small"
type="primary"
>
查询
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
<el-button
size="small"
@click="handleReset"
>
重置
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header :left-span="24">
<span slot="left">共提现<span class="count-txt">{{ countObj.recordCount }}</span>次,累计分账金额<span class="count-txt">{{ countObj.totalAmount }}</span>元。</span>
<span slot="left">共提现<span class="count-txt">{{ countObj.recordCount }}</span>次,累计分账金额<span
class="count-txt">{{ countObj.totalAmount }}</span>元。</span>
</d2-table-header>
<d2-table
ref="merchantTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
/>
<d2-table ref="merchantTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn" />
</div>
</d2-container>
</template>
<script>
import { Util } from '@/common/util'
import { Util, deepClone } from '@/common/util'
import { getWithdrawList, getWithdrawCountApi } from '@/api/account'
import { getCurrentSixMonth, withdrawStatusList, withdrawChannelList } from '@/common/constants.js'
export default {
......@@ -171,7 +162,7 @@ export default {
},
getParams() {
var params = _.cloneDeep(this.searchForm)
var params = deepClone(this.searchForm)
if (params.withDrawDate && params.withDrawDate.length) {
params.startDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[0]), 'YYYY-MM-DD')
params.endDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[1]), 'YYYY-MM-DD')
......
......@@ -41,11 +41,11 @@
<script>
import { mapActions, mapState } from 'vuex'
import { Util } from '@/common/util'
import { Util, deepClone } from '@/common/util'
// import { divisionTypeList } from '@/common/constants.js'
// getSeviceCountApi, getSeviceListApi, exportSeviceApi,getSeviceExport
import { getPartnerYqListApi, getSeviceList, getSeviceCount } from '@/api/account'
import { asyncExportExcel } from '@api/sys.base'
// import { asyncExportExcel } from '@api/sys.base'
export default {
name: 'ServiceOfflineList',
data() {
......@@ -209,7 +209,7 @@ export default {
},
getParams() {
var params = _.cloneDeep(this.searchForm)
var params = deepClone(this.searchForm)
const tempParams = this.getSelectInputParams()
params = {
...params,
......
......@@ -85,12 +85,12 @@
<script>
import { mapActions, mapState } from 'vuex'
import { Util } from '@/common/util'
import { Util, deepClone } from '@/common/util'
import cashDialog from './cashDialog'
import { divisionStatusList } from '@/common/constants.js'
// getSeviceExport
import { getBankBalanceApi, getPartnerYqListApi, getSeviceList, getSeviceCount } from '@/api/account'
import { asyncExportExcel } from '@api/sys.base'
// import { asyncExportExcel } from '@api/sys.base'
export default {
name: 'ServiceOnlineList',
data() {
......@@ -252,7 +252,7 @@ export default {
},
baseData: {
parkServiceList: [],
divisionStatusList: _.cloneDeep(divisionStatusList)
divisionStatusList: deepClone(divisionStatusList)
}
}
},
......@@ -301,7 +301,7 @@ export default {
},
getParams() {
var params = _.cloneDeep(this.searchForm)
var params = deepClone(this.searchForm)
const tempParams = this.getSelectInputParams()
params = {
...params,
......@@ -380,7 +380,7 @@ export default {
// 提现弹窗
handleCash() {
this.handleCashClose()
Object.assign(this.cashForm, _.cloneDeep(this.withdrawBalanceInfo))
Object.assign(this.cashForm, deepClone(this.withdrawBalanceInfo))
},
handleCashClose() {
this.cashVisible = !this.cashVisible
......
......@@ -101,9 +101,10 @@ import {
rangePickerOptions
} from '@/common/constants.js'
import dayjs from 'dayjs'
import { deepClone } from '@/common/util'
// import * as api from '@api/finance'
import { getMerchantPageSearch } from '@api/publicAccount'
import { asyncExportExcel } from '@api/sys.base'
// import { asyncExportExcel } from '@api/sys.base'
import { mapActions, mapState } from 'vuex'
export default {
name: 'DownloadAccountDialog',
......@@ -268,7 +269,7 @@ export default {
handleAddConfirm() {
this.$refs.accountForm.validate(valid => {
if (valid) {
var infoForm = _.cloneDeep(this.infoForm)
var infoForm = deepClone(this.infoForm)
console.log(infoForm)
var params = {}
var merchantList = []
......
......@@ -465,6 +465,7 @@
<script>
import { mapActions } from 'vuex'
import { deepClone } from '@/common/util'
import { shop4sDeductChargeFlagObj, partnerDeductChargeFlagObj, payType } from '@/common/constants'
export default {
name: 'FinanceDetail',
......@@ -480,7 +481,7 @@ export default {
1: '预录升级',
2: '现场升级'
},
payTypeOpts: _.cloneDeep(payType),
payTypeOpts: deepClone(payType),
// {
// '1': '微信支付',
......
......@@ -116,10 +116,10 @@
</el-card>
<d2-search ref="showSearch"
class="show-search"
:searchForm="searchForm"
:searchSelectObj="searchSelectObj"
:formData="showFormData"
:labelWidth="'100px'"
:search-form="searchForm"
:search-select-obj="searchSelectObj"
:form-data="showFormData"
:label-width="'100px'"
style="background: #fff;">
<div class="up-btns"
style="bottom:10px; ">
......@@ -576,8 +576,8 @@ import {
import downloadAccountDialog from './downloadAccountDialog'
import warehouseDetail from './warehouseDetail'
import * as echarts from 'echarts'
import { asyncExportExcel } from '@api/sys.base'
import { returnFloat } from '@/common/util'
// import { asyncExportExcel } from '@api/sys.base'
import { returnFloat, deepClone } from '@/common/util'
export default {
name: 'FinanceList',
components: {
......@@ -667,17 +667,17 @@ export default {
{
label: '分账方式',
name: 'divisionType',
optionList: _.cloneDeep(divisionTypeList)
optionList: deepClone(divisionTypeList)
},
{
label: '支付方式',
name: 'payType',
optionList: _.cloneDeep(payTypeList)
optionList: deepClone(payTypeList)
},
{
label: '订单类型',
name: 'orderType',
optionList: _.cloneDeep(orderTypeList)
optionList: deepClone(orderTypeList)
}
],
handleSelectChange: value => {
......@@ -742,20 +742,20 @@ export default {
baseData: {
parkServiceList: [],
storeIdList: [],
divisionTypeList: _.cloneDeep(divisionTypeList),
orderTypeList: _.cloneDeep(orderTypeList),
warehouseStatusList: _.cloneDeep(warehouseStatusList),
// sourceChannelTypeList: _.cloneDeep(sourceChannelTypeList),
manageTypeList: _.cloneDeep(manageTypeList),
divisionTypeList: deepClone(divisionTypeList),
orderTypeList: deepClone(orderTypeList),
warehouseStatusList: deepClone(warehouseStatusList),
// sourceChannelTypeList: deepClone(sourceChannelTypeList),
manageTypeList: deepClone(manageTypeList),
PlatformMerchantList: [],
channelTypeList: [],
channelTypeList: []
},
total: 0,
page: {
currentPage: 1,
pageSize: 20
},
payTypeOpts: _.cloneDeep(payType),
payTypeOpts: deepClone(payType),
// {
// 1: '微信支付',
// 2: '4S店支付',
......@@ -1035,7 +1035,7 @@ export default {
'franchiseeProfitPer',
'shopProfitPer',
'yqProfitPer',
'glProfitPer',
'glProfitPer'
]
for (const key in item) {
if (moneyLabels.indexOf(key) > -1) {
......
......@@ -447,7 +447,8 @@ import { mapActions, mapState } from 'vuex'
// import { mapActions } from 'vuex'
import { divisionTypeList, payTypeList, payType } from '@/common/constants.js'
import * as echarts from 'echarts'
import { asyncExportExcel } from '@api/sys.base'
import { deepClone } from '@/common/util'
// import { asyncExportExcel } from '@api/sys.base'
export default {
name: 'ServiceFinanceList',
data() {
......@@ -519,11 +520,11 @@ export default {
selectOption: [{
label: '分账方式',
name: 'divisionType',
optionList: _.cloneDeep(divisionTypeList)
optionList: deepClone(divisionTypeList)
}, {
label: '支付方式',
name: 'payType',
optionList: _.cloneDeep(payTypeList)
optionList: deepClone(payTypeList)
}],
handleSelectChange: (value) => {
this.searchSelectObj.typeSelect.value = ''
......@@ -546,7 +547,7 @@ export default {
baseData: {
parkServiceList: [],
storeIdList: [],
divisionTypeList: _.cloneDeep(divisionTypeList)
divisionTypeList: deepClone(divisionTypeList)
},
// 服务商 - 查看详情
serviceVisible: false,
......@@ -556,7 +557,7 @@ export default {
pageNum: 1,
pageSize: 20
},
payTypeOpts: _.cloneDeep(payType),
payTypeOpts: deepClone(payType),
// {
// '1': '微信支付',
// '2': '4S店支付',
......
<!-- 领用详情 -->
<template>
<div class="couponsDetail">
<d2-table
ref="couponsDetailTable"
:has-num="false"
:base-data="baseData"
:sort-obj="sortObj"
:search-form="searchFormSearch"
:head-search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn"
@handleTableHeadChange="handleTableHeadChange"
>
<span
slot="couponName"
slot-scope="scope"
>{{ scope.scope.couponName }}{{ scope.scope.customerCouponCode }}</span>
<d2-table ref="couponsDetailTable"
:has-num="false"
:base-data="baseData"
:sort-obj="sortObj"
:search-form="searchFormSearch"
:head-search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn"
@handleTableHeadChange="handleTableHeadChange">
<span slot="couponName"
slot-scope="scope">{{ scope.scope.couponName }}{{ scope.scope.customerCouponCode }}</span>
</d2-table>
</div>
</template>
<script>
import { getDetailList, getDistinctColum } from '@api/coupons'
import { Util } from '@/common/util'
import { Util, deepClone } from '@/common/util'
export default {
name: 'CouponsDetail',
data() {
......@@ -158,7 +154,7 @@ export default {
},
// 表格头部搜索-改变
handleTableHeadChange({ searchItemName, checkedList }) {
this.searchForm[searchItemName] = _.cloneDeep(checkedList)
this.searchForm[searchItemName] = deepClone(checkedList)
this.keyDowmGetList()
},
beforeSearchFn() {
......
<!-- 发券宝 - 店里列表 -->
<template>
<div class="coupons">
<d2-table
ref="couponsTable"
:has-num="false"
:base-data="baseData"
:sort-obj="sortObj"
:search-form="searchFormSearch"
:head-search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn"
@handleTableHeadChange="handleTableHeadChange"
>
<template
slot="auth-button"
slot-scope="scope"
>
<d2-table ref="couponsTable"
:has-num="false"
:base-data="baseData"
:sort-obj="sortObj"
:search-form="searchFormSearch"
:head-search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn"
@handleTableHeadChange="handleTableHeadChange">
<template slot="auth-button"
slot-scope="scope">
<auth-button :data="scope.scope" />
</template>
</d2-table>
<edit-coupons-dialog
:coupons-visible="couponsVisible"
:coupon-info="couponInfo"
@couponClose="couponClose"
/>
<edit-coupons-dialog :coupons-visible="couponsVisible"
:coupon-info="couponInfo"
@couponClose="couponClose" />
</div>
</template>
<script>
import { mapActions } from 'vuex'
import { BaseData } from '@/common/constants.js'
import { deepClone } from '@/common/util'
import editCouponsDialog from './editCouponsDialog'
import { getList, deleteCouponApi, updateCouponApi } from '@api/coupons'
import { commonConfigApi } from '@api/sys.base'
......@@ -172,8 +167,8 @@ export default {
get: 'd2admin/base/get'
}),
async getBaseData() {
// this.tableParams.tableColumns[this.findFormIdx('couponTypeName')].optionList = _.cloneDeep(await this.get(BaseData.productType))
this.baseData.couponTypeList = _.cloneDeep(await this.get(BaseData.productType))
// this.tableParams.tableColumns[this.findFormIdx('couponTypeName')].optionList = deepClone(await this.get(BaseData.productType))
this.baseData.couponTypeList = deepClone(await this.get(BaseData.productType))
this.$nextTick()
},
getCommonConfig() {
......@@ -203,7 +198,7 @@ export default {
// 表格头部搜索-改变
handleTableHeadChange({ searchItemName, checkedList }) {
this.searchForm[searchItemName] = _.cloneDeep(checkedList)
this.searchForm[searchItemName] = deepClone(checkedList)
this.keyDowmGetList()
},
......
<!-- 按规格关联门店弹窗 -->
<template>
<d2-dialog title="按规格分配"
:is-visible.sync="speciRelateStoreVisible"
width="70%"
btn-ok-label="提交"
@confirmDialog="handleSpeciRelateStoreConfirm"
@closeDialog="handleSpeciRelateStoreClose"
class="relateStore">
<slot />
<div class="shopSpeci-box" v-for="(item, index) in specificationValueList" :key="index">
<div class="top">
<div class="top-left">
<span class="title">商品{{index + 1}}:</span>
<span>{{baseGoodsName}}</span><span v-for="(val, idx) in item.specsValueList" :key="idx">{{val}}</span>
</div>
<div class="top-center">>>></div>
<div class="top-right">
<span class="title"><span class="text-red">*</span>门店:</span>
<!-- v-el-select-loadmore="interestsLoadmore" remote reserve-keyword :remote-method="remoteMethod"
:loading="interesLoading"-->
<el-select style="width: 430px;" @change="e => selectChange(e, index)"
filterable collapse-tags remote reserve-keyword :remote-method="remoteMethod"
v-model="item.selectedMerchantIds" multiple @visible-change="visibleChange" placeholder="请选择">
<el-option
v-for="(v, k) in merchantList"
v-show="!merchantName || (merchantName && v.isShowItem == 1)"
:key="k"
:label="(v.merchant && v.merchant.merchantName) + ' ' + (v.merchant && v.merchant.merchantId)"
:value="v.merchant && v.merchant.merchantId"
:disabled="!v.isSetUpgradeSettleRule">
</el-option>
</el-select>
</div>
</div>
<div class="bottom" v-if="item.selectedMerchantList && item.selectedMerchantList.length">
<div style="margin-bottom: 15px;">已分配:</div>
<div class="merchant-tag">
<div class="flex_1" v-for="(subItem, subIndex) in item.selectedMerchantList" :key="subIndex">
<el-tag closable @close="handleSpescDelete(subItem, index)">{{subItem.merchantName + ' ' + subItem.merchantId}}</el-tag>
</div>
</div>
</div>
</div>
</d2-dialog>
</template>
<script>
export default {
name: 'RelateStoreDialog',
data() {
return {
selectedData: [],
merchantList: [],
currentPage: 1,
pageSize: 9999,
merchantName: '',
interesLoading: false
}
},
props: {
speciRelateStoreVisible: {
type: Boolean,
default: false
},
// 页面来源
sourcePage: {
type: String,
default: ''
},
storeApi: {
type: Function,
default: () => { }
},
storeSelected: {
type: Array,
default: () => []
},
storeSearchForm: {
type: Object,
default: () => { }
},
specificationValueList: {
type: Array,
default: () => []
},
baseGoodsName: {
type: String,
default: () => ''
},
baseGoodsId: {
type: Number,
default: () => 0
},
selectedSceneCode: {
typeof: Number,
default: () => 0
}
// 去掉表格中某些字段
// noTableField: {
// type: Array,
// default: () => []
// }
},
mounted() {
this.selectedData = this.storeSelected
if (this.merchantList.length) return
this.getSelectingList()
},
directives: {
'el-select-loadmore': {
bind (el, binding) {
const SELECTWRAP_DOM = el.querySelector(
'.el-select-dropdown .el-select-dropdown__wrap'
)
SELECTWRAP_DOM.addEventListener('scroll', function () {
const condition =
this.scrollHeight - this.scrollTop <= this.clientHeight
if (condition) {
binding.value()
}
})
}
}
},
methods: {
selectChange(e, index) {
let arr = this.merchantList.filter(val => e.indexOf(val.merchantId) > -1)
this.specificationValueList[index].selectedMerchantList = arr
},
remoteMethod(query) {
this.merchantName = query;
this.currentPage = 1;
this.interestsOptions = [];
this.interesLoading = true;
if (query) {
this.getSelectingList(); // 请求接口
}
},
visibleChange(data) {
// 获取焦点重新渲染下拉框数据
if (data) this.merchantName = ''
},
interestsLoadmore(){
setTimeout(() => {
this.currentPage = this.currentPage + 1;
if (this.allPages < this.currentPage) {
this.currentPage = this.allPages
return;
}
this.getSelectingList();
}, 10);
},
getSelectingList() {
this.storeApi({
merchantName: this.merchantName,
currentPage: this.currentPage,
scene: this.selectedSceneCode,
pageSize: this.pageSize
}).then(res => {
this.interesLoading = false
this.allPages = res.pages
let arr = []
res.list && res.list.forEach(val => {
val.merchantId = val.merchantId ? val.merchantId : val.merchant?.merchantId
val.merchantName = val.merchantName ? val.merchantName : val.merchant?.merchantName
val.yqMerchantId = val.yqMerchantId ? val.yqMerchantId : val.yqMerchant?.merchantId
val.yqMerchantName = val.yqMerchantName ? val.yqMerchantName : val.yqMerchant?.merchantName
if (this.merchantName) {
arr.push(val.merchantId)
}
})
if (!this.merchantName) {
this.merchantList = res.list
} else {
this.merchantList.forEach(val => {
if (arr.indexOf(val.merchantId) > -1) {
this.$set(val, 'isShowItem', 1)
} else {
this.$set(val, 'isShowItem', 0)
}
})
}
})
},
handleSpescDelete(subItem, index) {
this.specificationValueList[index].selectedMerchantList.splice(
this.specificationValueList[index].selectedMerchantList.findIndex(v => v.merchantId == subItem.merchantId), 1
)
this.specificationValueList[index].selectedMerchantIds.splice(this.specificationValueList[index].selectedMerchantIds.findIndex(v => v == subItem.merchantId), 1)
},
handleSpeciRelateStoreConfirm() {
let [flag, index] = [true, 0]
for (var i = 0; i < this.specificationValueList.length; i++) {
let item = this.specificationValueList[i]
if (!item.selectedMerchantIds.length) {
flag = false
index = i
break
}
}
if (!flag) {
return this.$message({
message: `请为商品${index + 1}分配门店`,
type: 'error'
})
}
let arr = []
this.specificationValueList.forEach(val => {
let merchantList = []
val.selectedMerchantList.forEach(v => {
merchantList.push({
merchantId: v.merchantId,
merchantName: v.merchantName
})
})
arr.push({
id: val.id,
// specificationData: val.specificationData,
merchantList: merchantList
})
})
this.$emit('handleSpeciRelateStoreConfirm', arr)
},
handleSpeciRelateStoreClose() {
this.$emit('handleSpeciRelateStoreClose')
}
}
}
</script>
<style lang="scss">
.shopSpeci-box{
padding: 0 60px;
.top{
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0;
.top-left{
color: #666666;
span{
margin-right: 10px;
}
.title {
color: #1D1D1D;
}
}
.top-center{
font-weight: 600;
background-image: -webkit-linear-gradient(left, #3E69E4, #C5CFF8);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.top-right{
.title{
color: #1D1D1D;
.text-red{
color: #EB4E4E;
}
}
.el-select__tags{
width: 100% !important;
}
.el-tag.el-tag--info {
width: auto;
.el-select__tags-text{
width: auto;
}
}
}
}
.bottom{
background: #F9F9F9;
padding: 16px 20px;
.merchant-tag{
display: flex;
flex-wrap: wrap;
.flex_1{
flex: 0 0 50%;
margin: 5px 0;
}
}
}
}
</style>
......@@ -115,14 +115,16 @@
</template>
<script>
import _ from 'lodash'
import { limitPrice } from '@/common/constants'
// import _ from 'lodash'
import { deepClone } from '@/common/util'
import { limitPrice, warrantyProList } from '@/common/constants'
// warrantyProList
export default {
name: 'RelateProDialog',
data() {
return {
goodVal: {},
warrantyProList: [1, 4, 6],
warrantyProList: warrantyProList,
proInfo: {
thumbUrl: '',
goodsCode: '',
......@@ -196,7 +198,7 @@ export default {
default: () => []
},
originProInfo: {
type: Object,
type: [String, Object],
default: () => { }
}
},
......@@ -208,7 +210,7 @@ export default {
confLabel: i
})
}
this.proInfo = this.originProInfo ? _.cloneDeep(this.originProInfo) : _.cloneDeep(this.proInfo)
this.proInfo = this.originProInfo ? deepClone(this.originProInfo) : deepClone(this.proInfo)
!this.proInfo.incentiveType && (this.proInfo.incentiveType = 1)
},
......@@ -255,7 +257,7 @@ export default {
handleWarrantyPeriod(newVal) {
this.proInfo.warrantyPeriod = limitPrice(newVal, this.oldVal.warrantyPeriod, 2, 1)
this.oldVal.warrantyPeriod = this.proInfo.warrantyPeriod
},
}
}
}
......
<!-- 关联门店弹窗 -->
<template>
<d2-dialog title="关联门店"
<d2-dialog title="统一分配门店"
:is-visible.sync="relateStoreVisible"
width="70%"
btn-ok-label="关联"
......@@ -8,8 +8,10 @@
@closeDialog="handleRelateStoreClose"
class="relateStore">
<slot />
<el-row>
<el-col :span="12">
<el-row class="tableCon">
<!-- <el-col :span="12"> -->
<div class="tableBox">
<el-table ref="seletingTable"
:data="selectingData"
height="464px"
......@@ -54,45 +56,54 @@
:page-size="pageSize"
layout="total, prev, pager, next"
:total="total" />
</el-col>
<el-col :span="12">
<el-table :data="selectedData"
class="table"
border
height="464px">
<el-table-column v-if="sourcePage != 'serviceStore'"
prop="yqMerchantName"
label="园区店名称"
align="center" />
<el-table-column prop="merchantName"
label="4S店名称"
align="center" />
<el-table-column prop="warrantyType"
label="选择质保"
align="center">
</div>
<!-- </el-col> -->
<!-- <el-col :span="12"> -->
<el-table class="tableBox table"
:data="selectedData"
border
height="464px">
<el-table-column v-if="sourcePage != 'serviceStore'"
prop="yqMerchantName"
label="园区店名称"
align="center" >
<template slot-scope="scope">
<span>
<el-select style="width: 90%;"
v-model="scope.row.warrantyType">
<el-option v-for="item in warrantyTypeList"
:key="item.confId"
:label="item.confLabel"
:value="item.confId" />
</el-select>
</span>
<span>{{ scope.row.yqMerchantName }}</span>
</template>
</el-table-column>
<el-table-column label="删除"
align="center"
width="50px">
<template slot-scope="scope">
<el-button class="el-icon-delete"
@click="handleDelete(scope.row)"
type="text" />
</el-table-column>
<el-table-column prop="merchantName"
label="4S店名称"
align="center" >
<template slot-scope="scope">
<span>{{ scope.row.merchantName}}</span>
</template>
</el-table-column>
</el-table>
</el-col>
</el-table-column>
<!-- <el-table-column prop="warrantyType"
label="选择质保"
align="center">
<template slot-scope="scope">
<span>
<el-select style="width: 90%;"
v-model="scope.row.warrantyType">
<el-option v-for="item in warrantyTypeList"
:key="item.confId"
:label="item.confLabel"
:value="item.confId" />
</el-select>
</span>
</template>
</el-table-column> -->
<el-table-column label="删除"
align="center"
width="50px">
<template slot-scope="scope">
<el-button class="el-icon-delete"
@click="handleDelete(scope.row)"
type="text" />
</template>
</el-table-column>
</el-table>
<!-- </el-col> -->
</el-row>
</d2-dialog>
</template>
......@@ -140,6 +151,10 @@ export default {
storeSearchForm: {
type: Object,
default: () => { }
},
selectedSceneCode: {
typeof: Number,
default: () => 0
}
// 去掉表格中某些字段
// noTableField: {
......@@ -166,21 +181,33 @@ export default {
recoverySelection() {
var exitIds = this.selectedData.map(item => item.merchantId)
this.selectingData.forEach(item => {
item.merchant
exitIds.includes(item.merchantId) && this.$refs.seletingTable.toggleRowSelection(item, true)
})
},
getSelectingList() {
this.storeApi({
...this.storeSearchForm,
scene: this.selectedSceneCode,
currentPage: this.currentPage,
pageSize: this.pageSize
}).then(res => {
this.selectingData = res.list.map(item => {
if (!item.warrantyType) {
item.warrantyType = 0
res.list.forEach(val => {
val.merchantId = val.merchant?.merchantId
val.merchantName = val.merchant?.merchantName
val.yqMerchantId = val.yqMerchant?.merchantId
val.yqMerchantName = val.yqMerchant?.merchantName
if (!val?.warrantyType) {
val.warrantyType = 0
}
return item
})
this.selectingData = res.list
// this.selectingData = res.list.map(item => {
// if (!item.warrantyType) {
// item.warrantyType = 0
// }
// return item
// })
this.total = res.total
this.$nextTick(() => {
this.recoverySelection()
......@@ -188,7 +215,6 @@ export default {
})
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(item => item.merchantId === row.merchantId)
addOrDelete
? this.selectedData.push(row)
......@@ -207,7 +233,8 @@ export default {
},
handleDelete(row) {
this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId)
this.$refs.seletingTable.toggleRowSelection(row)
let obj = this.selectingData.find(v => v.merchantId == row.merchantId)
this.$refs.seletingTable.toggleRowSelection(obj)
},
handleCurrentChange(val) {
this.currentPage = val
......@@ -223,11 +250,17 @@ export default {
}
</script>
<style>
<style lang="scss">
.relateStore .table {
margin: 0 auto 20px !important;
width: 98%;
}
.relateStore .tableCon {
display: flex;
.tableBox {
flex: 1;
}
}
.service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell {
line-height: 26px !important;
......
......@@ -53,27 +53,27 @@
v-for="(item,index) in commodityInfo.upgradeGoodsList"
:key="index">
<p class="car-sub-head">
商品{{ index + 1 }}-{{ item.goodsInfo.goodsName }}
商品{{ index + 1 }}-{{ item.specificationData ? (item.goodsInfo.goodsName + ' ' + item.specificationData) : item.goodsInfo.goodsName }}
</p>
<!-- <el-form-item class="d2-drawer-item"
label="商品名称:">
<span>{{item.goodsInfo.goodsName}}</span>
</el-form-item> -->
<el-form-item class="d2-drawer-item"
label="品牌:">
label="品牌方:">
<span>{{ item.goodsInfo.brandMerchantName }}</span>
</el-form-item>
<el-form-item class="d2-drawer-item"
label="分类:">
label="类目:">
<span>{{ item.goodsInfo.goodsTypeName }}</span>
</el-form-item>
<el-form-item class="d2-drawer-item"
label="产品成本:">
label="商品成本:">
<span>{{ item.shopPrice ? (item.shopPrice + '元') : '无' }}</span>
</el-form-item>
<!-- style="font-weight: bold;" -->
<el-form-item class="d2-drawer-item"
label="建议升级价:">
label="商品零售价:">
<!-- class="car-strong-txt" -->
<span>{{ item.upgradePrice }}元</span>
</el-form-item>
......@@ -81,7 +81,17 @@
label="商品最低价:">
<span>{{ item.shopMinPrice ? (item.shopMinPrice + '元') : '无' }}</span>
</el-form-item>
<el-form-item v-if="warrantyProList.includes(item.goodsInfo.goodsType)"
<!-- <el-form-item v-if="warrantyProList.includes(item.goodsInfo.goodsType)"
class="d2-drawer-item"
label="质保年限:">
<span>{{ item.warrantyPeriod ? (item.warrantyPeriod + '年') : '无' }}</span>
</el-form-item> -->
<el-form-item
class="d2-drawer-item"
label="库存:">
<span>{{ item.stock ? (item.stock) : '无' }}</span>
</el-form-item>
<el-form-item
class="d2-drawer-item"
label="质保年限:">
<span>{{ item.warrantyPeriod ? (item.warrantyPeriod + '年') : '无' }}</span>
......@@ -136,13 +146,13 @@
<el-table-column prop="merchantId"
label="商户编号"
align="center" />
<el-table-column prop="userType"
<!-- <el-table-column prop="userType"
label="商户类型"
align="center">
<template slot-scope="scope">
<span>{{ baseData[scope.row.channelType === 2 ? 'ghUserTypeList' : 'userTypeList'][scope.row.userType] }}</span>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column prop="warrantyType"
label="质保类型"
align="center">
......@@ -158,13 +168,13 @@
<script>
import { getGoodsInfoById, submitReviewResult } from '@/api/commodity'
import { userType, ghUserType } from '@/common/constants'
import { userType, ghUserType, warrantyProList } from '@/common/constants'
export default {
name: 'DrawerDetail',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
warrantyProList: [1, 4, 6],
warrantyProList: warrantyProList,
commodityInfo: {
goodsInfo: {}
},
......@@ -217,8 +227,11 @@ export default {
getInfo(id) {
getGoodsInfoById({ id: id }).then(res => {
res.upgradeGoodsList && res.upgradeGoodsList.forEach(v => {
v.goodsInfo.goodsName = res.baseGoodsName ? res.baseGoodsName : v.goodsInfo.goodsName
})
this.commodityInfo = res
this.commodityInfo.linkMerchants = res.merchantRefList ? res.merchantRefList.map(item => Object.assign(item, item.merchantInfo)) : []
this.commodityInfo.linkMerchants = res.upgradeGoodsMerchantRefList ? res.upgradeGoodsMerchantRefList : []
})
},
......
......@@ -6,6 +6,7 @@
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
@handleChangeSelect="handleChangeSelect"
:form-data="showFormData">
<!-- <p>
<el-input
......@@ -34,21 +35,23 @@
<span slot="left">
<auth-button category="Button"
style="{display: inline-block}"
show-btn-ids="['9030101']" />
:show-btn-ids="['9030101']" />
</span>
<auth-button category="Button"
style="{display: inline-block}"
show-btn-ids="['9030103']" />
:show-btn-ids="['9030103']" />
</d2-table-header>
<d2-table ref="productTable"
:search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn">
<img slot="img"
slot-scope="scope"
<div class="material" slot="img" slot-scope="scope">
<img
class="pro-img"
:src="scope.scope.thumbUrl">
<span class="good_name">{{scope.scope.goodsName}}</span>
</div>
<auth-button slot="auth-button"
slot-scope="scope"
:data="scope.scope" />
......@@ -58,11 +61,12 @@
</template>
<script>
import _ from 'lodash'
// import _ from 'lodash'
import { deepClone } from '@/common/util'
// exportGoodsList
import { getList, deleteGoods, checkDeleteGoods } from '@api/product'
import { BaseData, brandMerchantList } from '@/common/constants.js'
import { asyncExportExcel } from '@api/sys.base'
import { getList, deleteGoods, checkDeleteGoods, getProductTypeBySceneId } from '@api/product'
import { BaseData, brandMerchantList, scenCodeList } from '@/common/constants.js'
// import { asyncExportExcel } from '@api/sys.base'
import { mapActions, mapState } from 'vuex'
// import { exportJsonToExcel } from '@/common/Export2Excel.js'
export default {
......@@ -70,11 +74,12 @@ export default {
data() {
return {
searchForm: {
// goodsName: '',
goodsName: '',
goodsType: '',
brandMerchantCode: '',
sceneType: ''
// brandMerchantCode: '',
// status: '',
createTime: ''
// createTime: ''
},
showFormData: [
// {
......@@ -83,23 +88,46 @@ export default {
// type: 'input'
// },
{
label: '分类',
name: 'goodsType',
type: 'select',
optionList: [],
optionId: 'goodsType',
optionLabel: 'goodsTypeName',
optionsName: 'productTypeList'
label: '素材名',
name: 'goodsName',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '品牌商',
name: 'brandMerchantCode',
label: '所属场景',
name: 'sceneType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'brandList'
optionsName: 'scenCodeList'
}, {
label: '类目名',
name: 'goodsType',
type: 'select',
optionList: [],
optionId: 'categoryType',
optionLabel: 'categoryName',
optionsName: 'productTypeList'
},
// {
// label: '素材名',
// name: 'goodsType',
// type: 'select',
// optionList: [],
// optionId: 'goodsType',
// optionLabel: 'goodsTypeName',
// optionsName: 'productTypeList'
// }, {
// label: '品牌商',
// name: 'brandMerchantCode',
// type: 'select',
// optionList: [],
// optionId: 'confId',
// optionLabel: 'confValue',
// optionsName: 'brandList'
// },
// {
// label: '状态',
// name: 'status',
// type: 'select',
......@@ -108,19 +136,14 @@ export default {
// optionLabel: 'confValue',
// optionsName: 'statusList'
// },
{
label: '创建时间',
name: 'createTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
}, {
label: '素材名称',
name: 'goodsName',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}],
// {
// label: '创建时间',
// name: 'createTime',
// type: 'datePicker',
// isClear: true,
// pickerOptions: 'rangePickerOptions'
// }
],
getListApi: getList,
// 表格参数
tableParams: {
......@@ -128,31 +151,38 @@ export default {
listName: 'list',
tableOption: true,
tableColumns: [{
label: '缩略图',
prop: 'thumbUrl',
label: '素材名',
prop: 'goodsName',
addHtml: 'img'
}, {
label: '素材名称',
prop: 'goodsName'
}, {
label: '素材ID',
prop: 'id'
}, {
label: '分类',
label: '类目',
prop: 'goodsTypeName'
}, {
label: '品牌商',
prop: 'brandMerchantName'
}, {
label: '创建时间',
label: '所属场景',
prop: 'sceneName'
},
// {
// label: '素材ID',
// prop: 'id'
// }, {
// label: '分类',
// prop: 'goodsTypeName'
// }, {
// label: '品牌商',
// prop: 'brandMerchantName'
// },
{
label: '创建日期',
prop: 'createDateStr'
}, {
label: '状态',
prop: 'status',
formatter: (cellValue) => {
return this.baseData.statusList.find(item => item.confId === cellValue.status).confValue
}
}]
}
// {
// label: '状态',
// prop: 'status',
// formatter: (cellValue) => {
// return this.baseData.statusList.find(item => item.confId === cellValue.status).confValue
// }
// }
]
},
// 查看门店
detailVisible: false,
......@@ -166,7 +196,8 @@ export default {
}, {
confId: 1,
confValue: '使用'
}]
}],
scenCodeList: []
}
}
},
......@@ -178,11 +209,18 @@ export default {
},
mounted() {
this.baseData.brandList = _.cloneDeep(brandMerchantList)
this.baseData.brandList = deepClone(brandMerchantList)
this.baseData.scenCodeList = deepClone(scenCodeList)
var allOpt = { confId: '', confValue: '全部' }
this.baseData.brandList.unshift(allOpt)
this.baseData.statusList.unshift(allOpt)
this.getBaseData()
this.baseData.scenCodeList.unshift(allOpt)
// 获取全部类目
getProductTypeBySceneId({ sceneType: '' }).then(res => {
this.searchForm.goodsType = ''
this.baseData.productTypeList = res
this.getBaseData()
})
},
methods: {
......@@ -192,10 +230,10 @@ export default {
close: 'd2admin/page/close'
}),
async getBaseData() {
this.baseData.productTypeList = _.cloneDeep(await this.get(BaseData.productType))
// this.baseData.productTypeList = deepClone(await this.get(BaseData.productType))
this.baseData.productTypeList.unshift({
goodsType: '',
goodsTypeName: '全部'
id: '',
categoryName: '全部'
})
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
......@@ -207,23 +245,34 @@ export default {
this.$refs.productTable.refreshTable()
},
// 根据所选场景获取类目
handleChangeSelect(value) {
getProductTypeBySceneId({ sceneType: value }).then(res => {
this.baseData.productTypeList = res
this.getBaseData()
})
},
beforeSearchFn() {
return new Promise(resolve => {
if (this.searchForm.createTime) {
this.searchForm.startDate = new Date(this.searchForm.createTime[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
this.searchForm.endDate = new Date(this.searchForm.createTime[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} else {
this.searchForm.startDate = ''
this.searchForm.endDate = ''
}
// if (this.searchForm.createTime) {
// this.searchForm.startDate = new Date(this.searchForm.createTime[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
// this.searchForm.endDate = new Date(this.searchForm.createTime[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
// } else {
// this.searchForm.startDate = ''
// this.searchForm.endDate = ''
// }
resolve()
})
},
handleReset() {
this.searchForm = {
goodsType: '',
brandMerchantCode: ''
// brandMerchantCode: ''
// status: ''
goodsName: '',
sceneType: '',
}
},
handleAdd(form) {
......@@ -315,13 +364,24 @@ export default {
}
</script>
<style scoped>
.material{
padding: 0 60px;
display: flex;
justify-content: left;
align-items: center;
}
.good_name{
margin-left: 20px;
}
</style>
<style>
.product {
position: relative;
}
.product .pro-img {
width: 80px;
height: 80px;
width: 36px;
height: 36px;
}
.product p {
margin: 0;
......
......@@ -132,7 +132,7 @@
import { getMerchantPageSearch } from '../../api/publicAccount'
import { pushObject, addContact, modifyContact, importContact, removeContact } from '../../api/merchant'
import { mapActions, mapState, mapMutations } from 'vuex'
import { deepClone } from '@/common/util'
const state = [
{
value: 1,
......@@ -217,13 +217,13 @@ export default {
merchantName: [{ required: true, message: '请选择商户', trigger: 'change' }],
name: [{ required: true, message: '请输入姓名', trigger: 'change' }],
phone: [{ required: true, message: '请输入手机号', trigger: 'change' },
{
validator: (rule, value, callback) => {
const phoneReg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
return phoneReg.test(value) ? callback() : callback(new Error('请输入正确的联系号码'))
},
trigger: 'change'
}
{
validator: (rule, value, callback) => {
const phoneReg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
return phoneReg.test(value) ? callback() : callback(new Error('请输入正确的联系号码'))
},
trigger: 'change'
}
]
},
fileRules: {
......@@ -272,7 +272,7 @@ export default {
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = _.cloneDeep(this.searchForm)
this.tableSearchForm = deepClone(this.searchForm)
resolve()
})
},
......
......@@ -214,6 +214,7 @@
<script>
import { mapActions } from 'vuex'
import signRefundDialog from './signRefundDialog'
import { deepClone } from '@/common/util'
import { payType } from '@/common/constants.js'
// import { getOrderDetail } from '@api/order'
import dayjs from 'dayjs'
......@@ -246,7 +247,7 @@ export default {
1: '未支付',
2: '已支付'
},
payTypeOpts: _.cloneDeep(payType),
payTypeOpts: deepClone(payType),
// {
// '1': '微信支付',
// '2': '4S店支付',
......
......@@ -5,9 +5,9 @@
slot="header">
<d2-search ref="showSearch"
class="show-search"
:searchForm="searchForm"
:labelWidth="'100px'"
:formData="showFormData"></d2-search>
:search-form="searchForm"
:label-width="'100px'"
:form-data="showFormData" />
<div class="up-btns">
<el-button @click="handleSearch"
size="small"
......@@ -253,11 +253,11 @@
<script>
import { Util } from '@/common/util'
import { getList, exportFile, getOrderCount, waitinputorderCount, orderImport } from '@api/order'
import { sourceChannelTypeList, manageTypeList, BaseData } from '@/common/constants'
import { getList, getOrderCount, waitinputorderCount, orderImport } from '@api/order'
import { manageTypeList, BaseData } from '@/common/constants'
import { mapActions, mapState, mapMutations } from 'vuex'
import { getServiceStore, getParkStore } from '@api/editCustomer'
import { asyncExportExcel } from '@api/sys.base'
// import { asyncExportExcel } from '@api/sys.base'
export default {
name: 'OrderList',
data() {
......@@ -469,7 +469,7 @@ export default {
parkServiceList: [],
storeIdList: [],
// sourceChannelTypeList: _.cloneDeep(sourceChannelTypeList),
manageTypeList: _.cloneDeep(manageTypeList),
manageTypeList: Util.deepClone(manageTypeList),
sourceList: [
{
confId: '1',
......@@ -480,7 +480,7 @@ export default {
confLabel: '系统导入'
}
],
channelTypeList: [],
channelTypeList: []
},
tableData: [],
total: 0,
......@@ -649,7 +649,7 @@ export default {
})
},
getParams() {
const params = _.cloneDeep(this.searchForm)
const params = Util.deepClone(this.searchForm)
const form = this.searchForm
if (form.orderTime && form.orderTime.length) {
......
......@@ -57,7 +57,7 @@
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
:selectableFn="selectableFn">
:selectable-fn="selectableFn">
<template slot="auth-button"
slot-scope="scope">
<el-button type="text"
......@@ -70,24 +70,21 @@
</div>
</d2-container>
<!-- 批量修改所属园区店 -->
<update-yqMerchant-dialog :merchantVisible="merchantDialogVisible"
:idList="ids"
<update-yqMerchant-dialog :merchant-visible="merchantDialogVisible"
:id-list="ids"
v-if="merchantDialogVisible"
@dialogClose="dialogClose" />
</div>
</template>
<script>
import { Util } from '@/common/util'
import _ from 'lodash'
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { getParkStore } from '@api/editCustomer'
// waitinputorderExport
import { payTypeList } from '@/common/constants.js'
import { waitinputorderCount, waitinputorderPage, getList, markAsNoUse } from '@api/order'
// import { asyncExportExcel } from '@api/sys.base'
import updateYqMerchantDialog from './updateYqMerchantDialog'
const clonePayTypeList = _.cloneDeep(payTypeList)
const clonePayTypeList = deepClone(payTypeList)
clonePayTypeList.splice(1, 1)
export default {
name: 'OrderSupplement',
......@@ -305,7 +302,7 @@ export default {
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = _.cloneDeep(this.searchForm)
this.searchFormSearch = deepClone(this.searchForm)
if (this.searchFormSearch.payDate) {
this.searchFormSearch.accountStartDate = Util.dateFormate(this.searchFormSearch.payDate[0], 'YYYY-MM-DD HH:mm:ss')
this.searchFormSearch.accountEndDate = Util.dateFormate(this.searchFormSearch.payDate[1], 'YYYY-MM-DD') + ' 23:59:59'
......@@ -411,7 +408,7 @@ export default {
selectableFn(row, index) {
var isSelect = true
if (row.inputStatus == '1') {//已补录流水不可勾选
if (row.inputStatus == '1') { // 已补录流水不可勾选
isSelect = false
}
return isSelect
......@@ -419,9 +416,9 @@ export default {
batchUpdateYqMerchant() {
var selectedData = []
console.log(this.$refs.recordTable.mutiSelectArr['orderSupplement']);
if (this.$refs.recordTable.mutiSelectArr['orderSupplement']) {
selectedData = this.$refs.recordTable.mutiSelectArr['orderSupplement']
console.log(this.$refs.recordTable.mutiSelectArr.orderSupplement)
if (this.$refs.recordTable.mutiSelectArr.orderSupplement) {
selectedData = this.$refs.recordTable.mutiSelectArr.orderSupplement
}
if (!selectedData.length) {
this.$message({
......@@ -446,9 +443,9 @@ export default {
batchMarkAsNoUse() {
var selectedData = []
console.log(this.$refs.recordTable.mutiSelectArr['orderSupplement']);
if (this.$refs.recordTable.mutiSelectArr['orderSupplement']) {
selectedData = this.$refs.recordTable.mutiSelectArr['orderSupplement']
console.log(this.$refs.recordTable.mutiSelectArr.orderSupplement)
if (this.$refs.recordTable.mutiSelectArr.orderSupplement) {
selectedData = this.$refs.recordTable.mutiSelectArr.orderSupplement
}
if (!selectedData.length) {
this.$message({
......
<!-- 下载对账单 -->
<template>
<d2-dialog
title="退款备注"
:is-visible="signRefundVisible"
class="accountDailog"
@closeDialog="handleClose"
@confirmDialog="handleAddConfirm"
>
<el-form
ref="refundForm"
:model="infoForm"
:rules="formRules"
>
<d2-dialog title="退款备注"
:is-visible="signRefundVisible"
class="accountDailog"
@closeDialog="handleClose"
@confirmDialog="handleAddConfirm">
<el-form ref="refundForm"
:model="infoForm"
:rules="formRules">
<el-form-item prop="remark">
<el-input
v-clear-emoij
type="textarea"
:rows="5"
placeholder="不超过100个字。"
maxlength="100"
show-word-limit
v-model="infoForm.remark"
/>
<el-input v-clear-emoij
type="textarea"
:rows="5"
placeholder="不超过100个字。"
maxlength="100"
show-word-limit
v-model="infoForm.remark" />
</el-form-item>
</el-form>
</d2-dialog>
......@@ -30,6 +24,7 @@
<script>
// import { getMerchantPageSearch } from '@api/publicAccount'
import { markAsRefunded } from '@api/order'
import { deepClone } from '@/common/util'
export default {
name: 'SignRefundDialog',
data() {
......@@ -72,7 +67,7 @@ export default {
handleAddConfirm() {
this.$refs.refundForm.validate(valid => {
if (valid) {
var infoForm = _.cloneDeep(this.infoForm)
var infoForm = deepClone(this.infoForm)
var params = {}
params.refundRemark = infoForm.remark
params.orderCode = this.detail.orderCode
......
......@@ -29,14 +29,15 @@
<script>
import { getParkStore } from '@api/editCustomer'
import { updateYqMerchant } from '@api/order'
import { deepClone } from '@/common/util'
export default {
name: 'updateYqMerchantDialog',
name: 'UpdateYqMerchantDialog',
data() {
return {
// userInfo: this.$store.state.d2admin.user.info,
infoForm: {
yqMerchantId: '',
idList: [],
idList: []
},
formRules: {
yqMerchantId: [
......@@ -60,7 +61,7 @@ export default {
idList: {
type: Array,
default: () => { }
},
}
},
watch: {
......@@ -89,7 +90,7 @@ export default {
this.$refs.merchantForm.validate(valid => {
if (valid) {
this.infoForm.idList = this.idList
var params = _.cloneDeep(this.infoForm)
var params = deepClone(this.infoForm)
updateYqMerchant(params).then(res => {
this.notice.okTips()
this.handleClose(true)
......
......@@ -3,67 +3,49 @@
<dialog-reg :is-visible="registerDialogVisible" />
<div class="page-login--layer page-login--layer-area">
<ul class="circles">
<li
v-for="n in 10"
:key="n"
/>
<li v-for="n in 10"
:key="n" />
</ul>
</div>
<div
class="page-login--layer page-login--layer-time"
flex="main:center cross:center"
>
<div class="page-login--layer page-login--layer-time"
flex="main:center cross:center">
{{ time }}
</div>
<div class="page-login--layer">
<div
class="page-login--content"
flex="dir:top main:justify cross:stretch box:justify"
>
<div class="page-login--content"
flex="dir:top main:justify cross:stretch box:justify">
<div class="page-login--content-header">
<p class="page-login--content-header-motto" />
</div>
<div
class="page-login--content-main"
flex="dir:top main:center cross:center"
>
<div class="page-login--content-main"
flex="dir:top main:center cross:center">
<!-- form -->
<div
class="page-login--form-box"
@click="handleReturnLogin"
>
<div
class="page-login--form"
v-show="!isMutiAccount"
>
<div class="page-login--form-box"
@click="handleReturnLogin">
<div class="page-login--form"
v-show="!isMutiAccount">
<div class="form-left">
<el-form
ref="loginForm"
label-position="top"
:rules="rules"
:model="formLogin"
size="default"
>
<el-form ref="loginForm"
label-position="top"
:rules="rules"
:model="formLogin"
size="default">
<div class="title-wrap">
<!-- <span class="form-title">{{systemName}}</span> -->
<span class="form-title">
<img
src="./image/title.png"
alt="D+智享车生活"
>
<img src="./image/title.png"
alt="D+智享车生活">
</span>
<span class="form-sub">{{ systemSubName }}</span>
</div>
<div class="input-wrap">
<el-form-item prop="userName">
<el-input
type="text"
@keyup.native.13="submit"
v-model="formLogin.userName"
placeholder="用户名"
clearable
v-focus
>
<el-input type="text"
@keyup.native.13="submit"
v-model="formLogin.userName"
placeholder="用户名"
clearable
v-focus>
<!-- <d2-el-icon
slot="prepend"
name="user"
......@@ -71,13 +53,11 @@
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
type="password"
v-model="formLogin.password"
@keyup.native.13="submit"
clearable
placeholder="密码"
>
<el-input type="password"
v-model="formLogin.password"
@keyup.native.13="submit"
clearable
placeholder="密码">
<!-- <d2-el-icon
slot="prepend"
name="key"
......@@ -85,21 +65,17 @@
</el-input>
</el-form-item>
<el-form-item class="form-action">
<el-button
@click="submit"
type="primary"
:loading="$store.state.d2admin.loading.value"
class="button-login"
:style="{'width': hasReg ? '' : '100%' }"
>
<el-button @click="submit"
type="primary"
:loading="$store.state.d2admin.loading.value"
class="button-login"
:style="{'width': hasReg ? '' : '100%' }">
登录
</el-button>
<el-button
v-if="hasReg"
@click.prevent="registerDialogVisible = true"
plain
class="button-reg"
>
<el-button v-if="hasReg"
@click.prevent="registerDialogVisible = true"
plain
class="button-reg">
注册
</el-button>
</el-form-item>
......@@ -111,20 +87,16 @@
<div class="img-bg" />
</div>
</div>
<div
class="page-login--muti-form"
v-show="isMutiAccount"
>
<div class="page-login--muti-form"
v-show="isMutiAccount">
<div class="muti-title">
请选择登陆商户号
</div>
<div class="muti-form-box">
<div
class="muti-merchant-item"
v-for="(item, index) in accountInfo.accountList"
:key="index"
@click.stop.prevent="handleSelectAccount(index)"
>
<div class="muti-merchant-item"
v-for="(item, index) in accountInfo.accountList"
:key="index"
@click.stop.prevent="handleSelectAccount(index)">
<i class="muti-dot" />
<div class="muti-merchant-info">
<p class="muti-merchant-name">
......@@ -160,12 +132,14 @@ import util from '@/libs/util.js'
import dayjs from 'dayjs'
import { mapActions } from 'vuex'
import { selectAccount, getUserInfo } from '@api/sys.account'
import { baseConfig } from '@/main'
export default {
components: {
DialogReg: () => import('./dialogReg')
},
data() {
return {
baseConfig,
registerDialogVisible: false,
timeInterval: null,
time: dayjs().format('HH:mm:ss'),
......@@ -558,14 +532,14 @@ export default {
.img-top {
width: 320px;
height: 24px;
background: url('./image/bz.png');
background: url("./image/bz.png");
background-size: 320px auto;
margin-bottom: 53px;
transform: translateY(20px);
}
.img-bg {
// box-sizing: border-box;
background: url('./image/bg.png') no-repeat;
background: url("./image/bg.png") no-repeat;
background-size: 320px auto;
width: 322px;
height: 276px;
......
<!-- 虚拟对公账户详情 -->
<template>
<div class="account-detail">
<el-form
:model="merchantRow"
label-width="190px"
>
<el-form :model="merchantRow"
label-width="190px">
<p class="edit-sub-title">
账户信息
</p>
<el-form-item
label="客户名称:"
prop="name"
>
<el-form-item label="客户名称:"
prop="name">
<span>{{ merchantRow.merchantName }}</span>
</el-form-item>
<p class="edit-sub-title">
申请资料
</p>
<block
v-for="(item, index) in formList"
:key="index"
>
<el-form-item
v-if="item.showAttrList ? item.showAttrList.includes(detailForm.custType) : true"
:label="typeof item.label === 'object' ? (item.label[currentPage] + ':') : (item.label + ':')"
:prop="item.prop"
>
<block v-for="(item, index) in formList"
:key="index">
<el-form-item v-if="item.showAttrList ? item.showAttrList.includes(detailForm.custType) : true"
:label="typeof item.label === 'object' ? (item.label[currentPage] + ':') : (item.label + ':')"
:prop="item.prop">
<span v-if="item.type === 'image'">
<img
v-for="(subItem, subIdx) in item.imgList"
:key="subIdx"
class="detail-img"
:src="detailForm.papersList[imgToAttr[subItem]]"
>
<img v-for="(subItem, subIdx) in item.imgList"
:key="subIdx"
class="detail-img"
:src="detailForm.papersList[imgToAttr[subItem]]">
</span>
<span v-else-if="item.formatter">{{ item.formatter(item) }}</span>
<span v-else>{{ detailForm[item.prop] }}</span>
......@@ -44,6 +34,7 @@
<script>
import { getDetailApi } from '@api/publicAccount'
import { deepClone } from '@/common/util'
export default {
name: 'AccountDetail',
data() {
......@@ -232,7 +223,7 @@ export default {
getDetailApi({ merchantId: this.merchantId }).then(res => {
// console.log(res)
this.currentPage = res.yseMerchantInfo ? res.yseMerchantInfo.custType : 'O'
this.detailForm = _.cloneDeep({
this.detailForm = deepClone({
...res.bankInfo,
...res.serviceMerchant,
...res.yseMerchantInfo,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!