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 = { ...@@ -139,6 +139,10 @@ module.exports = {
} }
], ],
"spaced-comment": [2, "always"], "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 = { module.exports = {
plugins: { plugins: {
autoprefixer: {} // 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 \ 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 @@ ...@@ -4,6 +4,8 @@
[Gitee](https://gitee.com/fairyever/d2-admin-start-kit) [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.4.0 本来用来开发审核以及报表功能版本, wangql_dev_v4.4.0 已开发部分对应需求,未往 dev_v4.4.0 版本合并,因此目前 dev_v4.4.0 分支无用
从 develop 拉分支号 dev_v4.5.1 用来开发转化加 V4.5.0 功能需求 从 develop 拉分支号 dev_v4.5.1 用来开发转化加 V4.5.0 功能需求
从 dev_v4.5.0 拉分支号 dev_v4.5.2 用来新建菜单对应现在的虚拟对公账户功能,以前的菜单保留以防万一 从 dev_v4.5.0 拉分支号 dev_v4.5.2 用来新建菜单对应现在的虚拟对公账户功能,以前的菜单保留以防万一
...@@ -29,3 +31,9 @@ dev_4.12.0_0927 版本上线后已往主干 develop 以及 master 上合并 ...@@ -29,3 +31,9 @@ dev_4.12.0_0927 版本上线后已往主干 develop 以及 master 上合并
从 develop 上拉取分支 dev_4.12.1 对应 1010 紧急版本 从 develop 上拉取分支 dev_4.12.1 对应 1010 紧急版本
dev_4.13.0 分支以上线并往 develop 以及 master 上合并 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 @@ ...@@ -7,8 +7,8 @@
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"start": "set NODE_OPTIONS=--openssl-legacy-provider && npm run serve", "start": "set NODE_OPTIONS=--openssl-legacy-provider && npm run serve",
"dev": "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": " vue-cli-service build --no-module",
"build:nomock": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode nomock", "build:nomock": "vue-cli-service build --mode nomock",
"build:travis": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode travis", "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", "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", "test:unit": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service test:unit",
...@@ -38,11 +38,11 @@ ...@@ -38,11 +38,11 @@
"js-cookie": "^2.2.0", "js-cookie": "^2.2.0",
"js-md5": "^0.7.3", "js-md5": "^0.7.3",
"jspdf": "^2.5.1", "jspdf": "^2.5.1",
"lodash": "^4.17.11",
"lowdb": "^1.0.0", "lowdb": "^1.0.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"qrcodejs2": "^0.0.2", "qrcodejs2": "^0.0.2",
"qs": "^6.8.0", "qs": "^6.8.0",
"rfdc": "^1.3.0",
"screenfull": "^4.2.0", "screenfull": "^4.2.0",
"sha1": "^1.1.1", "sha1": "^1.1.1",
"speed-measure-webpack-plugin": "^1.5.0", "speed-measure-webpack-plugin": "^1.5.0",
...@@ -77,9 +77,8 @@ ...@@ -77,9 +77,8 @@
"eslint-plugin-promise": "^5.1.0", "eslint-plugin-promise": "^5.1.0",
"eslint-plugin-vue": "^7.0.0", "eslint-plugin-vue": "^7.0.0",
"jest": "^27.1.0", "jest": "^27.1.0",
"postcss": "^8.4.16",
"postcss-loader": "^7.0.1",
"postcss-preset-env": "^7.7.2", "postcss-preset-env": "^7.7.2",
"postcss-px-to-viewport": "^1.1.1",
"sass": "^1.18.0", "sass": "^1.18.0",
"sass-loader": "^7.1.0", "sass-loader": "^7.1.0",
"script-loader": "^0.7.2", "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 \ 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 newline at end of file
No preview for this file type
...@@ -18,7 +18,7 @@ export default { ...@@ -18,7 +18,7 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
@import '~@/assets/style/public-class.scss'; @import "~@/assets/style/public-class.scss";
.el_table { .el_table {
thead { thead {
th { th {
......
...@@ -74,3 +74,45 @@ export function submitReviewResult(data) { ...@@ -74,3 +74,45 @@ export function submitReviewResult(data) {
data.method = `${path2}upgradedGoods.submitReviewResult` data.method = `${path2}upgradedGoods.submitReviewResult`
return request(data, 'post') return request(data, 'post')
} }
// 新增编辑商品
export function addOrEditBaseGoods(data) {
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 request from "./request"
import RequestMethods from './request.methods' import RequestMethods from "./request.methods"
const path = 'dj.api.' const path = "dj.api."
const path2 = 'dj.api.smartcarlife.' const path2 = "dj.api.smartcarlife."
export function getList(data) { export function getList(data) {
// data.method = `${path2}merchantSettleAccountRule.page.byMerchant` // 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) return request(data)
} }
...@@ -24,7 +25,7 @@ export function serviceGetMerchantList(data) { ...@@ -24,7 +25,7 @@ export function serviceGetMerchantList(data) {
// 获取已经关联的4s店商户号列表 // 获取已经关联的4s店商户号列表
export function getRefShopList(data) { export function getRefShopList(data) {
data.method = 'dj.api.smartcarlife.refedShop.merchantId.list' data.method = "dj.api.smartcarlife.refedShop.merchantId.list"
return request(data) return request(data)
} }
...@@ -36,7 +37,7 @@ export function addServiceMerchant(data) { ...@@ -36,7 +37,7 @@ export function addServiceMerchant(data) {
// 获取园区店关联的服务商信息 // 获取园区店关联的服务商信息
export function getPartnerByYq(data) { export function getPartnerByYq(data) {
data.method = 'dj.smartcarlife.api.partnerMerchant.getByYq' data.method = "dj.smartcarlife.api.partnerMerchant.getByYq"
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
...@@ -44,7 +45,7 @@ export function getPartnerByYq(data) { ...@@ -44,7 +45,7 @@ export function getPartnerByYq(data) {
// 获取财务设置进度 // 获取财务设置进度
export function getRuleProgressApi(data) { export function getRuleProgressApi(data) {
data.method = `${path2}merchantSettleAccountRule.get.progress` data.method = `${path2}merchantSettleAccountRule.get.progress`
return request(data, 'post') return request(data, "post")
} }
export function updateRule(data) { export function updateRule(data) {
...@@ -59,43 +60,43 @@ export function sendSms(data) { ...@@ -59,43 +60,43 @@ export function sendSms(data) {
export function getAdminInfo(data) { export function getAdminInfo(data) {
data.method = `${path2}sms.merchantCompantSms.adminInfo` data.method = `${path2}sms.merchantCompantSms.adminInfo`
return request(data, 'post') return request(data, "post")
} }
/** 根据商户号获取商户的财务结算规则 */ /** 根据商户号获取商户的财务结算规则 */
export function getAccountRule(data) { export function getAccountRule(data) {
data.method = `${path2}merchantSettleAccountRule.get.byMerchantId` data.method = `${path2}merchantSettleAccountRule.get.byMerchantId`
return request(data, 'post') return request(data, "post")
} }
// 财务 - 获取服务4s店(包含园区店、服务商信息)详情 // 财务 - 获取服务4s店(包含园区店、服务商信息)详情
export function getShopDetail(data) { export function getShopDetail(data) {
data.method = `${path}servicemerchantref.shop.detail` data.method = `${path}servicemerchantref.shop.detail`
return request(data, 'post') return request(data, "post")
} }
// 获取分账规则 // 获取分账规则
export function getDivisionRuleApi(data) { export function getDivisionRuleApi(data) {
data.method = `${path2}merchantDivisionRule.get.byMerchantId` data.method = `${path2}merchantDivisionRule.get.byMerchantId`
return request(data, 'post') return request(data, "post")
} }
// 修改分账规则 // 修改分账规则
export function updateDivisionRuleApi(data) { export function updateDivisionRuleApi(data) {
data.method = `${path2}merchantDivisionRule.update` data.method = `${path2}merchantDivisionRule.update`
return request(data, 'post') return request(data, "post")
} }
// 财务 - 2 - 获取导流方 // 财务 - 2 - 获取导流方
export function getMerchantLevelApi(data) { export function getMerchantLevelApi(data) {
data.method = `${path2}get.merchantLevel` data.method = `${path2}get.merchantLevel`
return request(data, 'post') return request(data, "post")
} }
// 财务 - 3 - 保存/验证金额 // 财务 - 3 - 保存/验证金额
export function moneyValidApi(data) { export function moneyValidApi(data) {
data.method = `${path2}divisionRuleTest.money.valid` data.method = `${path2}divisionRuleTest.money.valid`
return request(data, 'post') return request(data, "post")
} }
// 财务 - 3 - websocket // 财务 - 3 - websocket
...@@ -107,47 +108,71 @@ export function getWsUrlApi(data) { ...@@ -107,47 +108,71 @@ export function getWsUrlApi(data) {
// 商户管理 - 查看详情 - 修改入驻日期 // 商户管理 - 查看详情 - 修改入驻日期
export function entrydateUpdate(data) { export function entrydateUpdate(data) {
data.method = `${path2}entrydate.update` data.method = `${path2}entrydate.update`
return request(data, 'post') return request(data, "post")
} }
// 商户品牌-品牌设置 // 商户品牌-品牌设置
export function brandSetting(data) { export function brandSetting(data) {
data.method = `${path2}merchantbrandmodel.listBrandWithSeries` data.method = `${path2}merchantbrandmodel.listBrandWithSeries`
return request(data, 'post') return request(data, "post")
} }
// 商户品牌-配置车型 // 商户品牌-配置车型
export function configureCar(data) { export function configureCar(data) {
data.method = `${path2}merchantbrandmodel.update` data.method = `${path2}merchantbrandmodel.update`
return request(data, 'post') return request(data, "post")
} }
// 企微推送对象列表 // 企微推送对象列表
export function pushObject(data) { export function pushObject(data) {
data.method = `${path2}merchantConcat.page` data.method = `${path2}merchantConcat.page`
return request(data, 'post') return request(data, "post")
} }
// 新建企微联系人 // 新建企微联系人
export function addContact(data) { export function addContact(data) {
data.method = `${path2}merchantConcat.add` data.method = `${path2}merchantConcat.add`
return request(data, 'post') return request(data, "post")
} }
// 修改企微联系人 // 修改企微联系人
export function modifyContact(data) { export function modifyContact(data) {
data.method = `${path2}merchantConcat.modify` data.method = `${path2}merchantConcat.modify`
return request(data, 'post') return request(data, "post")
} }
// 导入企微联系人 // 导入企微联系人
export function importContact(data) { export function importContact(data) {
data.method = `${path2}merchantConcat.import` data.method = `${path2}merchantConcat.import`
return request(data, 'post', ['file']) return request(data, "post", ["file"])
} }
// 删除企微联系人 // 删除企微联系人
export function removeContact(data) { export function removeContact(data) {
data.method = `${path2}merchantConcat.remove` 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) { ...@@ -41,3 +41,33 @@ export function exportGoodsList(data) {
data.method = `${path}goodsinfo.export` data.method = `${path}goodsinfo.export`
return request(data, 'post') 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 @@ ...@@ -7,7 +7,7 @@
import sha1 from "sha1" import sha1 from "sha1"
import qs from "qs" import qs from "qs"
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import { deepClone } from "@/common/util"
// // const secret = // // const secret =
// // window.location.href.includes('dj.glsx.com.cn') || // // window.location.href.includes('dj.glsx.com.cn') ||
// // window.location.href.includes('dj.beta.glsx.com.cn') // // window.location.href.includes('dj.beta.glsx.com.cn')
...@@ -20,7 +20,7 @@ const sign = (params, noSignAttr = []) => { ...@@ -20,7 +20,7 @@ const sign = (params, noSignAttr = []) => {
const secret = baseConfig?.axios?.secret const secret = baseConfig?.axios?.secret
// console.log(secret) // console.log(secret)
delete params.sign delete params.sign
var objStr = qs.stringify(_.cloneDeep(params), { var objStr = qs.stringify(deepClone(params), {
arrayFormat: "indices", arrayFormat: "indices",
allowDots: true, allowDots: true,
encodeValuesOnly: true encodeValuesOnly: true
......
...@@ -71,3 +71,9 @@ export function exportExcel(data) { ...@@ -71,3 +71,9 @@ export function exportExcel(data) {
data.method = `${path}common.query.async.exportExcel` data.method = `${path}common.query.async.exportExcel`
return request(data, RequestMethods.POST) 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" ...@@ -3,6 +3,7 @@ import { Message, MessageBox, Loading } from "element-ui"
// import moment from 'moment' // import moment from 'moment'
import dayjs from "dayjs" import dayjs from "dayjs"
let loadingInstance = "" let loadingInstance = ""
export const Util = { export const Util = {
/** /**
* 简单alert * 简单alert
...@@ -225,28 +226,32 @@ export const Util = { ...@@ -225,28 +226,32 @@ export const Util = {
// * @param {*} obj // * @param {*} obj
// */ // */
deepClone: function (obj) { deepClone: function (obj) {
// Handle the 3 simple types, and null or undefined or function const clone = require("rfdc")({ proto: false, circles: false })
if (obj == null || typeof obj !== "object") return obj return clone(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.")
}, },
// 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下载文件 * url下载文件
......
// 组件 // 组件
import d2ContainerFull from './components/d2-container-full.vue' import d2ContainerFull from "./components/d2-container-full.vue"
import d2ContainerFullBs from './components/d2-container-full-bs.vue' import d2ContainerFullBs from "./components/d2-container-full-bs.vue"
import d2ContainerGhost from './components/d2-container-ghost.vue' import d2ContainerGhost from "./components/d2-container-ghost.vue"
import d2ContainerGhostBs from './components/d2-container-ghost-bs.vue' import d2ContainerGhostBs from "./components/d2-container-ghost-bs.vue"
import d2ContainerCard from './components/d2-container-card.vue' import d2ContainerCard from "./components/d2-container-card.vue"
import d2ContainerCardBs from './components/d2-container-card-bs.vue' import d2ContainerCardBs from "./components/d2-container-card-bs.vue"
// import d2Source from './components/d2-source.vue' // import d2Source from './components/d2-source.vue'
export default { export default {
name: 'd2-container', name: "d2-container",
props: { props: {
// 容器样式 // 容器样式
type: { type: {
type: String, type: String,
required: false, required: false,
default: 'full' default: "full"
}, },
// 滚动优化 // 滚动优化
betterScroll: { betterScroll: {
...@@ -26,34 +26,44 @@ export default { ...@@ -26,34 +26,44 @@ export default {
computed: { computed: {
// 始终返回渲染组件 // 始终返回渲染组件
component() { component() {
if (this.type === 'card' && !this.betterScroll) return d2ContainerCard if (this.type === "card" && !this.betterScroll) return d2ContainerCard
if (this.type === 'card' && this.betterScroll) return d2ContainerCardBs if (this.type === "card" && this.betterScroll) return d2ContainerCardBs
if (this.type === 'ghost' && !this.betterScroll) return d2ContainerGhost if (this.type === "ghost" && !this.betterScroll) return d2ContainerGhost
if (this.type === 'ghost' && this.betterScroll) return d2ContainerGhostBs if (this.type === "ghost" && this.betterScroll) return d2ContainerGhostBs
if (this.type === 'full' && !this.betterScroll) return d2ContainerFull if (this.type === "full" && !this.betterScroll) return d2ContainerFull
if (this.type === 'full' && this.betterScroll) return d2ContainerFullBs if (this.type === "full" && this.betterScroll) return d2ContainerFullBs
else { else {
return 'div' return "div"
} }
} }
}, },
render(h) { render(h) {
const slots = [this.$slots.default] const slots = [this.$slots.default]
if (this.$slots.header) slots.push(h('template', { slot: 'header' }, [this.$slots.header])) if (this.$slots.header)
if (this.$slots.footer) slots.push(h('template', { slot: 'footer' }, [this.$slots.footer])) slots.push(h("template", { slot: "header" }, [this.$slots.header]))
return h('div', { if (this.$slots.footer)
ref: 'container', slots.push(h("template", { slot: "footer" }, [this.$slots.footer]))
class: 'container-component' return h(
}, [ "div",
h(this.component, { {
ref: 'component', ref: "container",
props: this.$attrs, class: "container-component"
on: { },
scroll: e => this.$emit('scroll', e) [
} h(
}, slots) this.component,
// h(d2Source) {
]) ref: "component",
props: this.$attrs,
on: {
scroll: (e) => this.$emit("scroll", e)
}
},
slots
)
// h(d2Source)
]
)
}, },
methods: { methods: {
// 返回顶部 // 返回顶部
......
No preview for this file type
<!-- 关联门店弹窗 --> <!-- 关联门店弹窗 -->
<template> <template>
<d2-dialog <d2-dialog title="关联门店"
title="关联门店" :is-visible.sync="relateStoreVisible"
:is-visible.sync="relateStoreVisible" width="70%"
width="70%" btn-ok-label="关联"
btn-ok-label="关联" @confirmDialog="handleRelateStoreConfirm"
@confirmDialog="handleRelateStoreConfirm" @closeDialog="handleRelateStoreClose"
@closeDialog="handleRelateStoreClose" class="relateStore">
class="relateStore"
>
<slot /> <slot />
<el-row> <el-row class="tableCon">
<el-col :span="12"> <!-- <el-col :span="12"> -->
<el-table <div class="tableBox">
ref="seletingTable" <el-table ref="seletingTable"
:data="selectingData" :data="selectingData"
height="464px" height="464px"
class="table" class="table"
border border
@select="handleChange" @select="handleChange"
@select-all="handleAll" @select-all="handleAll">
> <el-table-column type="selection"
<el-table-column width="55"
type="selection" align="center"
width="55" :selectable="selectable" />
align="center" <el-table-column v-if="sourcePage != 'serviceStore'"
:selectable="selectable" prop="yqMerchantName"
/> label="园区店名称"
<el-table-column align="center">
v-if="sourcePage != 'serviceStore'"
prop="yqMerchantName"
label="园区店名称"
align="center"
>
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="merchantName"
prop="merchantName" label="4S店名称"
label="4S店名称" align="center">
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span :class="{'red': !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)}">{{ scope.row.merchantName }}</span> <span
<el-tooltip :class="{'red': !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)}">{{ scope.row.merchantName }}</span>
v-if="!scope.row.isSetUpgradeSettleRule" <el-tooltip v-if="!scope.row.isSetUpgradeSettleRule"
popper-class="tooltip-class" popper-class="tooltip-class"
effect="dark" effect="dark"
content="该门店无配置财务分润规则,无法关联!" content="该门店无配置财务分润规则,无法关联!"
placement="top" placement="top">
> <span v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)"
<span class="tip-icon">?</span>
v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)"
class="tip-icon"
>?</span>
</el-tooltip> </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> </template>
</el-table-column> </el-table-column>
</el-table> </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> </el-row>
</d2-dialog> </d2-dialog>
</template> </template>
...@@ -219,11 +197,17 @@ export default { ...@@ -219,11 +197,17 @@ export default {
} }
</script> </script>
<style> <style lang="scss">
.relateStore .table { .relateStore .table {
margin: 0 auto 20px !important; margin: 0 auto 20px !important;
width: 98%; width: 98%;
} }
.relateStore .tableCon {
display: flex;
.tableBox {
flex: 1;
}
}
.service-store .relateStore .el-table .cell, .service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell { .d2-form .relateStore .el-table .cell {
line-height: 26px !important; line-height: 26px !important;
......
...@@ -159,6 +159,10 @@ export default { ...@@ -159,6 +159,10 @@ export default {
// 选择框-添加其他属性 // 选择框-添加其他属性
selectAddAttr(value, targetItem) { selectAddAttr(value, targetItem) {
targetItem.changeAttr && targetItem.changeAttr(value, targetItem) targetItem.changeAttr && targetItem.changeAttr(value, targetItem)
// 根据所选值 获取数据
if (targetItem.name == 'sceneType') {
this.$emit('handleChangeSelect', value)
}
}, },
handleInputDown(e, item) { handleInputDown(e, item) {
if (e.keyCode === 13 && item.hasOwnProperty('keyFn')) { if (e.keyCode === 13 && item.hasOwnProperty('keyFn')) {
......
<!-- 表格+分页 --> <!-- 表格+分页 -->
<template> <template>
<div> <div>
<el-table <el-table :data="getListApi ? data : tableData"
:data="getListApi ? data : tableData" v-loading="loading"
v-loading="loading" border
border :highlight-current-row="true"
:highlight-current-row="true" :stripe="true"
:stripe="true" @sort-change="sortChange">
@sort-change="sortChange" <el-table-column align="center"
> width="60px"
<el-table-column label="序号"
align="center" type="index"
width="60px" :index="index=>index+(pagination.pageSize - 1) * pagination.pageCount + 1" />
label="序号" <el-table-column v-for="(item, index) in tableParams.tableColumns"
type="index" :key="index"
:index="index=>index+(pagination.pageSize - 1) * pagination.pageCount + 1" :label="item.label"
/> :prop="item.prop"
<el-table-column :width="item.width"
v-for="(item, index) in tableParams.tableColumns" :min-width="item.minWidth"
:key="index" :align="item.align||'center'"
:label="item.label" :sortable="item.sortable">
:prop="item.prop"
:width="item.width"
:min-width="item.minWidth"
:align="item.align||'center'"
:sortable="item.sortable"
>
<template slot-scope="scope"> <template slot-scope="scope">
<slot <slot v-if="item.addHtml"
v-if="item.addHtml" :name="item.addHtml"
:name="item.addHtml" :scope="scope.row"
:scope="scope.row" :prop="item.prop"
:prop="item.prop" :mom-flag="item.momFlag" />
:mom-flag="item.momFlag"
/>
<template v-else-if="item.momFlag"> <template v-else-if="item.momFlag">
<div> <div>
<span v-text="scope.row[item.prop]" /> <span v-text="scope.row[item.prop]" />
<span <span v-if="scope.row[item.momFlag] > 0"
v-if="scope.row[item.momFlag] > 0" class="el-icon-top" />
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"
class="el-icon-bottom"
/>
<span v-else-if="scope.row[item.momFlag] == 0">--</span> <span v-else-if="scope.row[item.momFlag] == 0">--</span>
</div> </div>
</template> </template>
<template v-else-if="item.tagLabel"> <template v-else-if="item.tagLabel">
<el-tag <el-tag v-if="!item.tagName"
v-if="!item.tagName" :type="tableParams.tag.type[scope.row[item.prop]]"
:type="tableParams.tag.type[scope.row[item.prop]]" v-text="tableParams.tag.label[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]]"
<el-tag v-text="tableParams[item.tagName].label[scope.row[item.prop]]" />
v-else
:type="tableParams[item.tagName].type[scope.row[item.prop]]"
v-text="tableParams[item.tagName].label[scope.row[item.prop]]"
/>
</template> </template>
<template v-else-if="item.formatter"> <template v-else-if="item.formatter">
<span v-text="item.formatter(scope.row)" /> <span v-text="item.formatter(scope.row)" />
...@@ -71,36 +55,31 @@ ...@@ -71,36 +55,31 @@
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column v-if="tableParams.tableOption"
v-if="tableParams.tableOption" label="操作"
label="操作" :align="tableParams.tableOption.align||'center'"
:align="tableParams.tableOption.align||'center'" :width="tableParams.tableOption.width||'200'"
:width="tableParams.tableOption.width||'200'" fixed="right">
fixed="right"
>
<template slot-scope="scope"> <template slot-scope="scope">
<slot <slot name="auth-button"
name="auth-button" :scope="scope.row" />
:scope="scope.row"
/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination v-if="hasPage"
v-if="hasPage" background
background @size-change="handleSizeChange"
@size-change="handleSizeChange" @current-change="handleCurrentChange"
@current-change="handleCurrentChange" :current-page="page.pageSize"
:current-page="page.pageSize" :page-sizes="[10,20,30,40]"
:page-sizes="[10,20,30,40]" :page-size="page.pageCount"
:page-size="page.pageCount" :total="getListApi ? total : tableTotal"
:total="getListApi ? total : tableTotal" layout="sizes,total,->,prev,pager,next,jumper" />
layout="sizes,total,->,prev,pager,next,jumper"
/>
</div> </div>
</template> </template>
<script> <script>
import { deepClone } from '@/common/util'
export default { export default {
name: 'D2Table', name: 'D2Table',
data() { data() {
...@@ -187,7 +166,7 @@ export default { ...@@ -187,7 +166,7 @@ export default {
if (!val[attr] && this.oldValue[attr]) { if (!val[attr] && this.oldValue[attr]) {
this.getListApi ? this.refreshEmit() : this.$emit('refreshTable', this.page) this.getListApi ? this.refreshEmit() : this.$emit('refreshTable', this.page)
} }
this.oldValue = _.cloneDeep(val) this.oldValue = deepClone(val)
}, },
deep: true deep: true
} }
......
<!-- 表格头部搜索 --> <!-- 表格头部搜索 -->
<template> <template>
<el-popover <el-popover placement="bottom"
placement="bottom" title=""
title="" width="150"
width="150" trigger="click"
trigger="click" v-model="isPopoverVisible">
v-model="isPopoverVisible"
>
<block> <block>
<p class="flex"> <p class="flex">
<el-checkbox <el-checkbox :indeterminate="isIndeterminate"
:indeterminate="isIndeterminate" v-model="checkAll"
v-model="checkAll" @change="handleCheckAllChange">
@change="handleCheckAllChange" 全选
>
全选
</el-checkbox> </el-checkbox>
<el-button <el-button @click="handleConfirm"
@click="handleConfirm" type="text">
type="text" 确定
>
确定
</el-button> </el-button>
</p> </p>
<el-checkbox-group <el-checkbox-group v-model="checkedList"
v-model="checkedList" @change="handleCheckedChange">
@change="handleCheckedChange" <el-checkbox v-for="item in baseData[optionConfig.searchItemName]"
> :label="item[optionConfig.optionId]"
<el-checkbox :key="item[optionConfig.optionId]"
v-for="item in baseData[optionConfig.searchItemName]" @change="handleCheckedChange">
:label="item[optionConfig.optionId]" {{ item[optionConfig.optionLabel] }}
:key="item[optionConfig.optionId]"
@change="handleCheckedChange"
>
{{ item[optionConfig.optionLabel] }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</block> </block>
<img <img slot="reference"
slot="reference" class="head-search"
class="head-search" src="./image/search.png"
src="./image/search.png" @click="handleOpen">
@click="handleOpen"
>
</el-popover> </el-popover>
</template> </template>
<script> <script>
import _ from 'lodash' // import _ from 'lodash'
import { deepClone } from '@/common/util'
export default { export default {
name: 'TableHeadSearch', name: 'TableHeadSearch',
data() { data() {
...@@ -83,7 +72,7 @@ export default { ...@@ -83,7 +72,7 @@ export default {
methods: { methods: {
handleOpen() { handleOpen() {
this.checkedList = _.cloneDeep(this.searchForm[this.optionConfig.searchItemName]) this.checkedList = deepClone(this.searchForm[this.optionConfig.searchItemName])
this.handleCheckedChange(this.checkedList) this.handleCheckedChange(this.checkedList)
this.$nextTick() this.$nextTick()
}, },
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
:highlight-current-row="true" :highlight-current-row="true"
@sort-change="sortChange" @sort-change="sortChange"
@selection-change="handleSelect" @selection-change="handleSelect"
:tree-props="{children: 'upgradeGoodsList'}"> :tree-props="{children: 'upgradeGoodsList'}"
:span-method="arraySpanMethod">
<el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" <el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
type="selection" type="selection"
:selectable="selectableFn" :selectable="selectableFn"
...@@ -19,7 +20,7 @@ ...@@ -19,7 +20,7 @@
width="60px" width="60px"
label="序号" label="序号"
type="index" 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" <el-table-column v-for="(item, index) in tableParams.tableColumns"
:key="index" :key="index"
:label="item.label" :label="item.label"
...@@ -42,6 +43,9 @@ ...@@ -42,6 +43,9 @@
:scope="scope.row" :scope="scope.row"
:prop="item.prop" :prop="item.prop"
:width="item.width" /> :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"> <template v-else-if="item.tagLabel">
<el-tag v-if="!item.tagName" <el-tag v-if="!item.tagName"
:type="tableParams.tag.type[scope.row[item.prop]]" :type="tableParams.tag.type[scope.row[item.prop]]"
...@@ -231,6 +235,17 @@ export default { ...@@ -231,6 +235,17 @@ export default {
type: Function, type: Function,
default: null default: null
}, },
// 列表数据需特殊处理
filterListData: {
type: Boolean,
default: false
},
// 合并单元格方法
arraySpanMethod: {
type: Function,
default: null
},
}, },
mounted() { mounted() {
...@@ -289,6 +304,28 @@ export default { ...@@ -289,6 +304,28 @@ export default {
// this.tableParams.needUnique && (res[this.tableParams.listName].forEach((item) => { // this.tableParams.needUnique && (res[this.tableParams.listName].forEach((item) => {
// item[this.tableParams.mutiSelectUniqueKey] // 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] this.data = res[this.tableParams.listName]
if (this.tableParams.needUnique) { if (this.tableParams.needUnique) {
let temp = 1 let temp = 1
......
import Vue from 'vue' import Vue from "vue"
import d2Container from './d2-container' import d2Container from "./d2-container"
import authButton from './d2-auth/d2-auth-btn.js' import authButton from "./d2-auth/d2-auth-btn.js"
// 注意 有些组件使用异步加载会有影响 // 注意 有些组件使用异步加载会有影响
Vue.component('D2Container', d2Container) Vue.component("D2Container", d2Container)
Vue.component('D2Icon', () => import('./d2-icon')) Vue.component("D2Icon", () => import("./d2-icon"))
Vue.component('D2ElIcon', () => import('./d2-el-icon')) Vue.component("D2ElIcon", () => import("./d2-el-icon"))
Vue.component('D2IconSvg', () => import('./d2-icon-svg/index.vue')) Vue.component("D2IconSvg", () => import("./d2-icon-svg/index.vue"))
Vue.component('D2TableHeader', () => import('./d2-table-header/index.vue')) Vue.component("D2TableHeader", () => import("./d2-table-header/index.vue"))
Vue.component('D2Table', () => import('./d2-table/index.vue')) Vue.component("D2Table", () => import("./d2-table/index.vue"))
Vue.component('D2Dialog', () => import('./d2-dialog/index.vue')) Vue.component("D2Dialog", () => import("./d2-dialog/index.vue"))
Vue.component('D2Form', () => import('./d2-form/index.vue')) Vue.component("D2Form", () => import("./d2-form/index.vue"))
Vue.component('D2Search', () => import('./d2-search/index.vue')) Vue.component("D2Search", () => import("./d2-search/index.vue"))
Vue.component('RelateStoreDialog', () => Vue.component("RelateStoreDialog", () =>
import('./d2-form/relateStoreDialog.vue') 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)
Vue.component(authButton.name, authButton) Vue.component(authButton.name, authButton)
<template> <template>
<div> <div>
<div class="d2-mr personal-wrap"> <div class="d2-mr personal-wrap">
<!-- <p class="bg-blue-500 text-5xl">111111</p> -->
<i class="el-icon-s-tools" <i class="el-icon-s-tools"
style="marginRight:20px;cursor:pointer" style="marginRight:20px;cursor:pointer"
v-if="userInfo.beSuper" v-if="userInfo.beSuper"
......
...@@ -23,14 +23,15 @@ ...@@ -23,14 +23,15 @@
<script> <script>
import { getPrivacyAgreement, insertOrUpdatePrivacyAgreement } from '@api/index' import { getPrivacyAgreement, insertOrUpdatePrivacyAgreement } from '@api/index'
import { deepClone } from '@/common/util'
export default { export default {
name: 'privacyAgreementDialog', name: 'PrivacyAgreementDialog',
data() { data() {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
infoForm: { infoForm: {
title: '', title: '',
module: 'PrivacyAgreement', module: 'PrivacyAgreement'
}, },
// 基本数据 // 基本数据
...@@ -67,7 +68,7 @@ export default { ...@@ -67,7 +68,7 @@ export default {
var params = {} var params = {}
params.module = this.infoForm.module params.module = this.infoForm.module
getPrivacyAgreement(params).then(res => { getPrivacyAgreement(params).then(res => {
this.infoForm.title = res ? res : '' this.infoForm.title = res || ''
}) })
}, },
...@@ -75,7 +76,7 @@ export default { ...@@ -75,7 +76,7 @@ export default {
// this.$refs.privacyForm.validate(valid => { // this.$refs.privacyForm.validate(valid => {
// if (valid) { // if (valid) {
var params = {} var params = {}
var infoForm = _.cloneDeep(this.infoForm) var infoForm = deepClone(this.infoForm)
params = infoForm params = infoForm
insertOrUpdatePrivacyAgreement(params).then(res => { insertOrUpdatePrivacyAgreement(params).then(res => {
this.notice.okTips() this.notice.okTips()
......
import low from 'lowdb' import low from "lowdb"
import LocalStorage from 'lowdb/adapters/LocalStorage' import LocalStorage from "lowdb/adapters/LocalStorage"
import util from '@/libs/util' import util from "@/libs/util"
const isDev = process.env.NODE_ENV === 'development' import { deepClone } from "@/common/util"
const adapter = new LocalStorage(`${process.env.VUE_APP_STORAGE_PREFIX}-${process.env.VUE_APP_VERSION}`, { const isDev = process.env.NODE_ENV === "development"
serialize: (data) => isDev ? JSON.stringify(data) : escape(JSON.stringify(data)), const adapter = new LocalStorage(
deserialize: (data) => isDev ? JSON.parse(data) : JSON.parse(unescape(data)) `${process.env.VUE_APP_STORAGE_PREFIX}-${process.env.VUE_APP_VERSION}`,
}) {
const db = low(adapter) serialize: (data) =>
isDev ? JSON.stringify(data) : escape(JSON.stringify(data)),
db deserialize: (data) =>
.defaults({ isDev ? JSON.parse(data) : JSON.parse(unescape(data))
sys: {}, }
database: {} )
}) const db = low(adapter)
.write()
db.defaults({
export default db sys: {},
database: {}
/** }).write()
* @description 检查路径是否存在 不存在的话初始化
* @param {Object} payload dbName {String} 数据库名称 export default db
* @param {Object} payload path {String} 路径
* @param {Object} payload user {Boolean} 区分用户 /**
* @param {Object} payload validator {Function} 数据校验钩子 返回 true 表示验证通过 * @description 检查路径是否存在 不存在的话初始化
* @param {Object} payload defaultValue {*} 初始化默认值 * @param {Object} payload dbName {String} 数据库名称
* @returns {String} 可以直接使用的路径 * @param {Object} payload path {String} 路径
*/ * @param {Object} payload user {Boolean} 区分用户
export function pathInit({ * @param {Object} payload validator {Function} 数据校验钩子 返回 true 表示验证通过
dbName = 'database', * @param {Object} payload defaultValue {*} 初始化默认值
path = '', * @returns {String} 可以直接使用的路径
user = true, */
validator = () => true, export function pathInit({
defaultValue = '' dbName = "database",
}) { path = "",
const uuid = util.cookies.get('uuid') || 'ghost-uuid' user = true,
const currentPath = `${dbName}.${user ? `user.${uuid}` : 'public'}${path ? `.${path}` : ''}` validator = () => true,
const value = db.get(currentPath).value() defaultValue = ""
if (!(value !== undefined && validator(value))) { }) {
db const uuid = util.cookies.get("uuid") || "ghost-uuid"
.set(currentPath, defaultValue) const currentPath = `${dbName}.${user ? `user.${uuid}` : "public"}${
.write() path ? `.${path}` : ""
} }`
return currentPath const value = db.get(currentPath).value()
} if (!(value !== undefined && validator(value))) {
db.set(currentPath, defaultValue).write()
/** }
* @description 将数据存储到指定位置 | 路径不存在会自动初始化 return currentPath
* @description 效果类似于取值 dbName.path = value }
* @param {Object} payload dbName {String} 数据库名称
* @param {Object} payload path {String} 存储路径 /**
* @param {Object} payload value {*} 需要存储的值 * @description 将数据存储到指定位置 | 路径不存在会自动初始化
* @param {Object} payload user {Boolean} 是否区分用户 * @description 效果类似于取值 dbName.path = value
*/ * @param {Object} payload dbName {String} 数据库名称
export function dbSet({ * @param {Object} payload path {String} 存储路径
dbName = 'database', * @param {Object} payload value {*} 需要存储的值
path = '', * @param {Object} payload user {Boolean} 是否区分用户
value = '', */
user = false export function dbSet({
}) { dbName = "database",
db.set(pathInit({ path = "",
dbName, value = "",
path, user = false
user }) {
}), value).write() db.set(
} pathInit({
dbName,
/** path,
* @description 获取数据 user
* @description 效果类似于取值 dbName.path || defaultValue }),
* @param {Object} payload dbName {String} 数据库名称 value
* @param {Object} payload path {String} 存储路径 ).write()
* @param {Object} payload defaultValue {*} 取值失败的默认值 }
* @param {Object} payload user {Boolean} 是否区分用户
*/ /**
export function dbGet({ * @description 获取数据
dbName = 'database', * @description 效果类似于取值 dbName.path || defaultValue
path = '', * @param {Object} payload dbName {String} 数据库名称
defaultValue = '', * @param {Object} payload path {String} 存储路径
user = false * @param {Object} payload defaultValue {*} 取值失败的默认值
}) { * @param {Object} payload user {Boolean} 是否区分用户
return new Promise(resolve => { */
resolve(_.cloneDeep(db.get(pathInit({ export function dbGet({
dbName, dbName = "database",
path, path = "",
user, defaultValue = "",
defaultValue user = false
})).value())) }) {
}) return new Promise((resolve) => {
} resolve(
deepClone(
/** db
* @description 获取存储数据库对象 .get(
* @param {Object} payload user {Boolean} 是否区分用户 pathInit({
*/ dbName,
export function database({ path,
dbName = 'database', user,
path = '', defaultValue
user = false, })
validator = () => true, )
defaultValue = '' .value()
} = {}) { )
return new Promise(resolve => { )
resolve(db.get(pathInit({ })
dbName, path, user, validator, defaultValue }
})))
}) /**
} * @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 @@ ...@@ -4,35 +4,41 @@
* @Last Modified by: chenwq * @Last Modified by: chenwq
* @Last Modified time: 2020-12-18 12:56:39 * @Last Modified time: 2020-12-18 12:56:39
*/ */
import { deepClone } from "@/common/util"
const permision = {} const permision = {}
/** /**
* 打包如有与按钮 * 打包如有与按钮
* resources 所有资源集合 * resources 所有资源集合
* idsInPermision 返回的权限id集合 * idsInPermision 返回的权限id集合
*/ */
permision.packRoutesBtns = function(resources, idsInPermision) { permision.packRoutesBtns = function (resources, idsInPermision) {
if (!resources || !idsInPermision || !idsInPermision.length) { if (!resources || !idsInPermision || !idsInPermision.length) {
throw new Error('参数错误') throw new Error("参数错误")
} }
const __aRouteInPermision = [] const __aRouteInPermision = []
const __oBtnInPermision = {} const __oBtnInPermision = {}
let __objResource = null let __objResource = null
let __obj = null let __obj = null
idsInPermision.forEach(obj => { idsInPermision.forEach((obj) => {
__objResource = resources[obj.authId] __objResource = resources[obj.authId]
if (__objResource) { // 直接能取到的为路由 (也可以在routes 中定标识变量) if (__objResource) {
// 直接能取到的为路由 (也可以在routes 中定标识变量)
__aRouteInPermision.push(resources[obj.authId]) // push 进 路由数组 __aRouteInPermision.push(resources[obj.authId]) // push 进 路由数组
} else { // 如果取不到 判断是否有父节点 并且父节点是否有auth属性 有 则视为按钮 (同样可以定义标识变量) } else {
// 如果取不到 判断是否有父节点 并且父节点是否有auth属性 有 则视为按钮 (同样可以定义标识变量)
__objResource = resources[obj.parentId] __objResource = resources[obj.parentId]
if (__objResource && __objResource.auth) { if (__objResource && __objResource.auth) {
__obj = __objResource.auth.find(o => +o.authId === +obj.authId) __obj = __objResource.auth.find((o) => +o.authId === +obj.authId)
if (__oBtnInPermision[obj.parentId] && __oBtnInPermision[obj.parentId].length) { if (
__oBtnInPermision[obj.parentId] &&
__oBtnInPermision[obj.parentId].length
) {
__oBtnInPermision[obj.parentId].push(__obj) __oBtnInPermision[obj.parentId].push(__obj)
} else { } else {
__oBtnInPermision[obj.parentId] = [__obj] __oBtnInPermision[obj.parentId] = [__obj]
} }
// __oBtnInPermision[obj.parentId] = __objResource.auth // __oBtnInPermision[obj.parentId] = __objResource.auth
// __aBtnIdAll = __aBtnIdAll.concat([...__objResource.auth.action.map(o=>o.authId),...__objResource.auth.operation.map(o=>o.authId)]) // __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) { ...@@ -47,11 +53,13 @@ permision.packRoutesBtns = function(resources, idsInPermision) {
* resources 所有资源集合 * resources 所有资源集合
* idsInPermision 返回的权限id集合 * idsInPermision 返回的权限id集合
*/ */
permision.packAsideMenus = function(resources, idsInPermision) { permision.packAsideMenus = function (resources, idsInPermision) {
if (!resources || !idsInPermision || !idsInPermision.length) { 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) { ...@@ -59,37 +67,40 @@ permision.packAsideMenus = function(resources, idsInPermision) {
* resources 所有资源集合 * resources 所有资源集合
* idsInPermision 返回的权限id集合 * idsInPermision 返回的权限id集合
*/ */
permision.packMenusBtns = function(resources) { permision.packMenusBtns = function (resources) {
if (!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: [] } return { menus, all: [] }
} }
const _loop = function(res, fnGetMenu) { const _loop = function (res, fnGetMenu) {
const __aParent = [] const __aParent = []
const __aSub = [] const __aSub = []
/** /**
* 第一次循环 分出一级菜单与所有子菜单 * 第一次循环 分出一级菜单与所有子菜单
*/ */
res.forEach(obj => { res.forEach((obj) => {
const __oMenu = fnGetMenu(obj) const __oMenu = fnGetMenu(obj)
if (!__oMenu) { // 不存在 可能是 按钮 直接继续循环 if (!__oMenu) {
// 不存在 可能是 按钮 直接继续循环
return true return true
} }
if (+(__oMenu.parentId) === 1) { // 取出1级菜单 if (+__oMenu.parentId === 1) {
// 取出1级菜单
__aParent.push(__oMenu) __aParent.push(__oMenu)
} else { // 取出子菜单 } else {
// 取出子菜单
__aSub.push(__oMenu) __aSub.push(__oMenu)
} }
}) })
/** /**
* 第二次循环所有子菜单 ,然后挂载到对应的一级菜单 * 第二次循环所有子菜单 ,然后挂载到对应的一级菜单
*/ */
let __parent = null let __parent = null
__aSub.forEach(obj => { __aSub.forEach((obj) => {
__parent = __aParent.find(menu => +(menu.authId) === +(obj.parentId)) __parent = __aParent.find((menu) => +menu.authId === +obj.parentId)
if (__parent) { if (__parent) {
if (__parent.children) { if (__parent.children) {
__parent.children.push(obj) __parent.children.push(obj)
...@@ -104,7 +115,7 @@ const _loop = function(res, fnGetMenu) { ...@@ -104,7 +115,7 @@ const _loop = function(res, fnGetMenu) {
/** /**
* 格式化菜单 封装成系统所需格式 * 格式化菜单 封装成系统所需格式
*/ */
permision.format2Menu = function(oMenu) { permision.format2Menu = function (oMenu) {
if (!oMenu) return null if (!oMenu) return null
const { icon, path, meta } = oMenu const { icon, path, meta } = oMenu
const { title, authId, parentId, sideHidden } = meta const { title, authId, parentId, sideHidden } = meta
...@@ -114,14 +125,14 @@ permision.format2Menu = function(oMenu) { ...@@ -114,14 +125,14 @@ permision.format2Menu = function(oMenu) {
path, path,
authId, authId,
parentId, parentId,
sideHidden sideHidden
} }
} }
/** /**
* 格式化菜单 封装成系统所需格式 * 格式化菜单 封装成系统所需格式
*/ */
permision.format2ResourceMenu = function(oMenu) { permision.format2ResourceMenu = function (oMenu) {
if (!oMenu) return null if (!oMenu) return null
const { icon, meta, auth } = oMenu const { icon, meta, auth } = oMenu
const { title, authId, parentId } = meta const { title, authId, parentId } = meta
...@@ -130,20 +141,22 @@ permision.format2ResourceMenu = function(oMenu) { ...@@ -130,20 +141,22 @@ permision.format2ResourceMenu = function(oMenu) {
icon, icon,
authId, authId,
parentId, parentId,
auth auth
} }
} }
/** /**
* 扁平化 routes (@/router/routes) * 扁平化 routes (@/router/routes)
*/ */
permision.flatten = function(arr) { permision.flatten = function (arr) {
return arr.reduce((result, item) => { return arr.reduce((result, item) => {
item.authId = item.authId || item.meta.authId item.authId = item.authId || item.meta.authId
item.parentId = item.parentId || item.meta.parentId item.parentId = item.parentId || item.meta.parentId
const cloneItem = _.cloneDeep(item) const cloneItem = deepClone(item)
delete cloneItem.auth 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 export default permision
...@@ -25,10 +25,6 @@ import "element-ui/lib/theme-chalk/index.css" ...@@ -25,10 +25,6 @@ import "element-ui/lib/theme-chalk/index.css"
// import ElementUI from 'element-ui' // import ElementUI from 'element-ui'
// Vue.use(ElementUI) // Vue.use(ElementUI)
// import menuHeader from '@/menu/header'
// import menuAside from '@/menu/aside'
// import { frameInRoutes } from '@/router/routes'
// 核心插件 // 核心插件
Vue.use(d2Admin) Vue.use(d2Admin)
Vue.use(chaining) Vue.use(chaining)
...@@ -82,11 +78,9 @@ fetch( ...@@ -82,11 +78,9 @@ fetch(
} }
) )
.then((response) => { .then((response) => {
// console.log(response)
const { code, data } = response const { code, data } = response
// console.log(aahph) // console.log(response)
code == "200" && (baseConfig = data) code == "200" && (baseConfig = data)
// console.log('data', data)
new Vue({ new Vue({
router, router,
store, store,
...@@ -97,16 +91,6 @@ fetch( ...@@ -97,16 +91,6 @@ fetch(
Vue.prototype.baseConfig = data Vue.prototype.baseConfig = data
return h(App) 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() { created() {
// 系统配置 // 系统配置
Vue.config.devtools = true Vue.config.devtools = true
...@@ -123,62 +107,4 @@ fetch( ...@@ -123,62 +107,4 @@ fetch(
}).$mount("#app") }).$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 } export { baseConfig }
...@@ -7,10 +7,19 @@ const chaining = { ...@@ -7,10 +7,19 @@ const chaining = {
const name = rest[key] const name = rest[key]
tmp = tmp?.[name] 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.$$ = optionalChaining
// vue.prototype.$sy = test
} }
} }
......
...@@ -82,6 +82,7 @@ export const sys = [ ...@@ -82,6 +82,7 @@ export const sys = [
* 905 - 财务管理 * 905 - 财务管理
* 906 - 系统设置 * 906 - 系统设置
* 908 - 我的分账 * 908 - 我的分账
* 909 - 活动管理
*/ */
export const resources = { export const resources = {
90703: { 90703: {
...@@ -287,7 +288,7 @@ export const resources = { ...@@ -287,7 +288,7 @@ export const resources = {
path: "/goods", path: "/goods",
name: "goods", name: "goods",
meta: { meta: {
title: "产品管理", title: "商品库",
authId: "903", authId: "903",
parentId: "1", parentId: "1",
cache: false cache: false
...@@ -371,7 +372,7 @@ export const resources = { ...@@ -371,7 +372,7 @@ export const resources = {
path: "/commodity", path: "/commodity",
name: "commodity", name: "commodity",
meta: { meta: {
title: "零售商品", title: "商品管理",
authId: "90302", authId: "90302",
parentId: "903", parentId: "903",
cache: false cache: false
...@@ -801,11 +802,19 @@ export const resources = { ...@@ -801,11 +802,19 @@ export const resources = {
label: "历史记录", label: "历史记录",
handle: "handleRecord" handle: "handleRecord"
}, },
// {
// authId: "9060305",
// parentId: "90603",
// label: "删除",
// handle: "handleDelete"
// },
{ {
authId: "9060305", authId: "9060307",
parentId: "90603", parentId: "90603",
label: "删除", label: "商户关联",
handle: "handleDelete" category: "Button",
type: "primary",
handle: "handleMerchantRelate"
} }
], ],
component: _import("systemConfig/merchant/merchantManage") component: _import("systemConfig/merchant/merchantManage")
...@@ -993,6 +1002,45 @@ export const resources = { ...@@ -993,6 +1002,45 @@ export const resources = {
activePath: "/accountList_new" activePath: "/accountList_new"
}, },
component: _import("systemConfig/accountNew/applyAccount") 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': { // '90602': {
// path: '/serviceStore', // path: '/serviceStore',
......
import router from '@/router' import router from "@/router"
import { database as getDatabase, dbGet, dbSet } from '@/libs/util.db' import { database as getDatabase, dbGet, dbSet } from "@/libs/util.db"
import { deepClone } from "@/common/util"
export default { export default {
namespaced: true, namespaced: true,
actions: { actions: {
/** /**
* @description 将数据存储到指定位置 | 路径不存在会自动初始化 * @description 将数据存储到指定位置 | 路径不存在会自动初始化
* @description 效果类似于取值 dbName.path = value * @description 效果类似于取值 dbName.path = value
* @param {Object} context * @param {Object} context
* @param {Object} payload dbName {String} 数据库名称 * @param {Object} payload dbName {String} 数据库名称
* @param {Object} payload path {String} 存储路径 * @param {Object} payload path {String} 存储路径
* @param {Object} payload value {*} 需要存储的值 * @param {Object} payload value {*} 需要存储的值
* @param {Object} payload user {Boolean} 是否区分用户 * @param {Object} payload user {Boolean} 是否区分用户
*/ */
set(context, { set(context, { dbName = "database", path = "", value = "", user = false }) {
dbName = 'database', dbSet({ dbName, path, value, user })
path = '', },
value = '', /**
user = false * @description 获取数据
}) { * @description 效果类似于取值 dbName.path || defaultValue
dbSet({ dbName, path, value, user }) * @param {Object} context
}, * @param {Object} payload dbName {String} 数据库名称
/** * @param {Object} payload path {String} 存储路径
* @description 获取数据 * @param {Object} payload defaultValue {*} 取值失败的默认值
* @description 效果类似于取值 dbName.path || defaultValue * @param {Object} payload user {Boolean} 是否区分用户
* @param {Object} context */
* @param {Object} payload dbName {String} 数据库名称 get(
* @param {Object} payload path {String} 存储路径 context,
* @param {Object} payload defaultValue {*} 取值失败的默认值 { dbName = "database", path = "", defaultValue = "", user = false }
* @param {Object} payload user {Boolean} 是否区分用户 ) {
*/ return dbGet({ dbName, path, defaultValue, user })
get(context, { },
dbName = 'database', /**
path = '', * @description 获取存储数据库对象
defaultValue = '', * @param {Object} context
user = false * @param {Object} payload user {Boolean} 是否区分用户
}) { */
return dbGet({ dbName, path, defaultValue, user }) database(context, { user = false } = {}) {
}, return getDatabase({
/** user,
* @description 获取存储数据库对象 defaultValue: {}
* @param {Object} context })
* @param {Object} payload user {Boolean} 是否区分用户 },
*/ /**
database(context, { * @description 清空存储数据库对象
user = false * @param {Object} context
} = {}) { * @param {Object} payload user {Boolean} 是否区分用户
return getDatabase({ */
user, databaseClear(context, { user = false } = {}) {
defaultValue: {} return getDatabase({
}) user,
}, validator: () => false,
/** defaultValue: {}
* @description 清空存储数据库对象 })
* @param {Object} context },
* @param {Object} payload user {Boolean} 是否区分用户 /**
*/ * @description 获取存储数据库对象 [ 区分页面 ]
databaseClear(context, { * @param {Object} context
user = false * @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
} = {}) { * @param {Object} payload user {Boolean} 是否区分用户
return getDatabase({ */
user, databasePage(context, { basis = "fullPath", user = false } = {}) {
validator: () => false, return getDatabase({
defaultValue: {} path: `$page.${router.app.$route[basis]}`,
}) user,
}, defaultValue: {}
/** })
* @description 获取存储数据库对象 [ 区分页面 ] },
* @param {Object} context /**
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ] * @description 清空存储数据库对象 [ 区分页面 ]
* @param {Object} payload user {Boolean} 是否区分用户 * @param {Object} context
*/ * @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
databasePage(context, { * @param {Object} payload user {Boolean} 是否区分用户
basis = 'fullPath', */
user = false databasePageClear(context, { basis = "fullPath", user = false } = {}) {
} = {}) { return getDatabase({
return getDatabase({ path: `$page.${router.app.$route[basis]}`,
path: `$page.${router.app.$route[basis]}`, user,
user, validator: () => false,
defaultValue: {} defaultValue: {}
}) })
}, },
/** /**
* @description 清空存储数据库对象 [ 区分页面 ] * @description 快速将页面当前的数据 ( $data ) 持久化
* @param {Object} context * @param {Object} context
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ] * @param {Object} payload instance {Object} vue 实例
* @param {Object} payload user {Boolean} 是否区分用户 * @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
*/ * @param {Object} payload user {Boolean} 是否区分用户
databasePageClear(context, { */
basis = 'fullPath', pageSet(context, { instance, basis = "fullPath", user = false }) {
user = false return getDatabase({
} = {}) { path: `$page.${router.app.$route[basis]}.$data`,
return getDatabase({ user,
path: `$page.${router.app.$route[basis]}`, validator: () => false,
user, defaultValue: deepClone(instance.$data)
validator: () => false, })
defaultValue: {} },
}) /**
}, * @description 快速获取页面快速持久化的数据
/** * @param {Object} context
* @description 快速将页面当前的数据 ( $data ) 持久化 * @param {Object} payload instance {Object} vue 实例
* @param {Object} context * @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
* @param {Object} payload instance {Object} vue 实例 * @param {Object} payload user {Boolean} 是否区分用户
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ] */
* @param {Object} payload user {Boolean} 是否区分用户 pageGet(context, { instance, basis = "fullPath", user = false }) {
*/ return dbGet({
pageSet(context, { path: `$page.${router.app.$route[basis]}.$data`,
instance, user,
basis = 'fullPath', defaultValue: deepClone(instance.$data)
user = false })
}) { },
return getDatabase({ /**
path: `$page.${router.app.$route[basis]}.$data`, * @description 清空页面快照
user, * @param {Object} context
validator: () => false, * @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ]
defaultValue: _.cloneDeep(instance.$data) * @param {Object} payload user {Boolean} 是否区分用户
}) */
}, pageClear(context, { basis = "fullPath", user = false }) {
/** return getDatabase({
* @description 快速获取页面快速持久化的数据 path: `$page.${router.app.$route[basis]}.$data`,
* @param {Object} context user,
* @param {Object} payload instance {Object} vue 实例 validator: () => false,
* @param {Object} payload basis {String} 页面区分依据 [ name | path | fullPath ] defaultValue: {}
* @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: {}
})
}
}
}
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 @@ ...@@ -22,99 +22,77 @@
@click="handleCash" @click="handleCash"
>提现></el-button> >提现></el-button>
</div> --> </div> -->
<div <div class="header"
class="header" slot="header">
slot="header" <d2-search ref="showSearch"
> class="show-search"
<d2-search :search-form="searchForm"
ref="showSearch" :form-data="showFormData">
class="show-search" <div slot="accountType"
:search-form="searchForm" style="display: flex; justify-content: space-between;">
:form-data="showFormData" <el-select v-model="searchForm.divisionType"
> @change="handleAccTypeChange">
<div <el-option v-for="item in baseData.divisionTypeList"
slot="accountType" :key="item.confId"
style="display: flex; justify-content: space-between;" :value="item.confId"
> :label="item.confLabel" />
<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>
<el-select v-model="searchForm.divisionStatus"> <el-select v-model="searchForm.divisionStatus">
<el-option <el-option v-for="item in (searchForm.divisionType === '2') ? baseData.divisionStatusList : [{ confId: '', confLabel: '全部' }]"
v-for="item in (searchForm.divisionType === '2') ? baseData.divisionStatusList : [{ confId: '', confLabel: '全部' }]" :key="item.confId"
:key="item.confId" :value="item.confId"
:value="item.confId" :label="item.confLabel" />
:label="item.confLabel"
/>
</el-select> </el-select>
</div> </div>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button <el-button :id="tableParams.btnId"
:id="tableParams.btnId" size="small"
size="small" type="primary">
type="primary" 查询
>
查询
</el-button> </el-button>
<el-button <el-button size="small"
size="small" @click="handleReset">
@click="handleReset" 重置
>
重置
</el-button> </el-button>
</div> </div>
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table-header :left-span="22"> <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> <span slot="left">共<span class="count-txt">{{ countObj.orderCount }}</span>笔订单,累计分账金额<span
<el-button class="count-txt">{{ countObj.partnerDivisionMoneyCount }}</span>元,分账成功金额<span
type="primary" class="count-txt">{{ countObj.partnerDivisionSuccessMoneyCount }}</span>元,分账中金额<span
size="mini" class="count-txt">{{ countObj.partnerInDivisionMoneyCount }}</span>元,分账失败金额<span
@click="handleExport" class="count-txt">{{ countObj.partnerDivisionFailureMoneyCount }}</span>元。</span>
> <el-button type="primary"
导出 size="mini"
@click="handleExport">
导出
</el-button> </el-button>
</d2-table-header> </d2-table-header>
<d2-table <d2-table ref="merchantTable"
ref="merchantTable" :get-list-api="getListApi"
:get-list-api="getListApi" :search-form="searchFormSearch"
:search-form="searchFormSearch" :table-params="tableParams"
:table-params="tableParams" :before-search-fn="beforeSearchFn">
:before-search-fn="beforeSearchFn" <template slot="divisionStatus"
> slot-scope="scope">
<template <span v-if="scope.scope.divisionStatus"
slot="divisionStatus" :style="{ 'color': [4, 5].includes(+scope.scope.divisionStatus) ? 'red' : '#606266' }">{{ baseData.divisionStatusList.find(item => +item.confId === scope.scope.divisionStatus).confLabel }}</span>
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> <span v-else>-</span>
</template> </template>
</d2-table> </d2-table>
</div> </div>
<cash-dialog <cash-dialog :cash-form="cashForm"
:cash-form="cashForm" :cash-visible="cashVisible"
:cash-visible="cashVisible" @handleCashConfirm="handleCashConfirm"
@handleCashConfirm="handleCashConfirm" @handleCashClose="handleCashClose" />
@handleCashClose="handleCashClose"
/>
</d2-container> </d2-container>
</template> </template>
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { Util } from '@/common/util' import { Util, deepClone } from '@/common/util'
import cashDialog from './cashDialog' import cashDialog from './cashDialog'
import { getCurrentSixMonth, divisionTypeList, divisionStatusList } from '@/common/constants.js' import { getCurrentSixMonth, divisionTypeList, divisionStatusList } from '@/common/constants.js'
// import { getPartnerYqListApi } from '@api/editCustomer' // import { getPartnerYqListApi } from '@api/editCustomer'
...@@ -204,7 +182,7 @@ export default { ...@@ -204,7 +182,7 @@ export default {
baseData: { baseData: {
parkServiceList: [], parkServiceList: [],
divisionStatusList: [], divisionStatusList: [],
divisionTypeList: _.cloneDeep(divisionTypeList) divisionTypeList: deepClone(divisionTypeList)
} }
} }
}, },
...@@ -216,7 +194,7 @@ export default { ...@@ -216,7 +194,7 @@ export default {
mounted() { mounted() {
this.getCount() this.getCount()
// this.getBankBalance() // this.getBankBalance()
this.baseData.divisionStatusList = _.cloneDeep(divisionStatusList) this.baseData.divisionStatusList = deepClone(divisionStatusList)
this.baseData.divisionStatusList.unshift({ this.baseData.divisionStatusList.unshift({
confId: '', confId: '',
confLabel: '全部' confLabel: '全部'
...@@ -241,7 +219,7 @@ export default { ...@@ -241,7 +219,7 @@ export default {
}, },
getParams() { getParams() {
var params = _.cloneDeep(this.searchForm) var params = deepClone(this.searchForm)
if (params.divisionDate && params.divisionDate.length) { if (params.divisionDate && params.divisionDate.length) {
params.divisionStartDate = Util.dateFormate(this.getMouthLastDate(params.divisionDate[0]), 'YYYY-MM-DD') params.divisionStartDate = Util.dateFormate(this.getMouthLastDate(params.divisionDate[0]), 'YYYY-MM-DD')
params.divisionEndDate = Util.dateFormate(this.getMouthLastDate(params.divisionDate[1]), 'YYYY-MM-DD') params.divisionEndDate = Util.dateFormate(this.getMouthLastDate(params.divisionDate[1]), 'YYYY-MM-DD')
...@@ -305,7 +283,7 @@ export default { ...@@ -305,7 +283,7 @@ export default {
// 提现弹窗 // 提现弹窗
handleCash() { handleCash() {
this.handleCashClose() this.handleCashClose()
Object.assign(this.cashForm, _.cloneDeep(this.withdrawBalanceInfo)) Object.assign(this.cashForm, deepClone(this.withdrawBalanceInfo))
}, },
handleCashClose() { handleCashClose() {
this.cashVisible = !this.cashVisible this.cashVisible = !this.cashVisible
......
<!-- 我的分账-提现记录 --> <!-- 我的分账-提现记录 -->
<template> <template>
<d2-container class="my-account-record"> <d2-container class="my-account-record">
<div <div class="header"
class="header" slot="header">
slot="header" <d2-search ref="showSearch"
> :search-form="searchForm"
<d2-search :form-data="showFormData" />
ref="showSearch"
:search-form="searchForm"
:form-data="showFormData"
/>
<div class="up-btns"> <div class="up-btns">
<el-button <el-button :id="tableParams.btnId"
:id="tableParams.btnId" size="small"
size="small" type="primary">
type="primary" 查询
>
查询
</el-button> </el-button>
<el-button <el-button size="small"
size="small" @click="handleReset">
@click="handleReset" 重置
>
重置
</el-button> </el-button>
</div> </div>
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table-header :left-span="24"> <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-header>
<d2-table <d2-table ref="merchantTable"
ref="merchantTable" :get-list-api="getListApi"
:get-list-api="getListApi" :search-form="searchFormSearch"
:search-form="searchFormSearch" :table-params="tableParams"
:table-params="tableParams" :before-search-fn="beforeSearchFn" />
:before-search-fn="beforeSearchFn"
/>
</div> </div>
</d2-container> </d2-container>
</template> </template>
<script> <script>
import { Util } from '@/common/util' import { Util, deepClone } from '@/common/util'
import { getWithdrawList, getWithdrawCountApi } from '@/api/account' import { getWithdrawList, getWithdrawCountApi } from '@/api/account'
import { getCurrentSixMonth, withdrawStatusList, withdrawChannelList } from '@/common/constants.js' import { getCurrentSixMonth, withdrawStatusList, withdrawChannelList } from '@/common/constants.js'
export default { export default {
...@@ -171,7 +162,7 @@ export default { ...@@ -171,7 +162,7 @@ export default {
}, },
getParams() { getParams() {
var params = _.cloneDeep(this.searchForm) var params = deepClone(this.searchForm)
if (params.withDrawDate && params.withDrawDate.length) { if (params.withDrawDate && params.withDrawDate.length) {
params.startDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[0]), 'YYYY-MM-DD') params.startDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[0]), 'YYYY-MM-DD')
params.endDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[1]), 'YYYY-MM-DD') params.endDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[1]), 'YYYY-MM-DD')
......
...@@ -283,9 +283,10 @@ ...@@ -283,9 +283,10 @@
</template> </template>
<script> <script>
import _ from 'lodash' // import _ from 'lodash'
import { Util } from '@/common/util' // import { deepClone } from '@/common/util'
import util from '@/libs/util' import { Util, deepClone } from '@/common/util'
// import util from '@/libs/util'
import { getServiceStore, getParkStore, getStaff, getCarInfo, getGoods, addOrder, editOrder } from '@api/editCustomer' import { getServiceStore, getParkStore, getStaff, getCarInfo, getGoods, addOrder, editOrder } from '@api/editCustomer'
import { BaseData } from '@/common/constants.js' import { BaseData } from '@/common/constants.js'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
...@@ -314,6 +315,7 @@ export default { ...@@ -314,6 +315,7 @@ export default {
callback() callback()
} }
return { return {
parkServiceList: [],
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
key: new Date(), key: new Date(),
isDisabled: false, isDisabled: false,
...@@ -405,7 +407,7 @@ export default { ...@@ -405,7 +407,7 @@ export default {
this.getServiceStore(this.userInfo.detail.merchantId) this.getServiceStore(this.userInfo.detail.merchantId)
} }
if (this.addOrEdit === 'edit') { 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.isDisabled = (this.form.operStatus !== 1)
this.form.customerSex = this.form.customerSex ? (this.form.customerSex + '') : '' this.form.customerSex = this.form.customerSex ? (this.form.customerSex + '') : ''
this.userInfo.beSuper && (this.form.sellerMerchantId = this.form.yqMerchantId) this.userInfo.beSuper && (this.form.sellerMerchantId = this.form.yqMerchantId)
......
...@@ -110,7 +110,8 @@ ...@@ -110,7 +110,8 @@
</template> </template>
<script> <script>
import _ from 'lodash' // import _ from 'lodash'
import { deepClone } from '@/common/util'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { getList, getOrderDetail, recordUpload, getOrderTotal } from '@api/recordList' import { getList, getOrderDetail, recordUpload, getOrderTotal } from '@api/recordList'
import { getServiceStore, getParkStore, getStaff, getGoods } from '@api/editCustomer' import { getServiceStore, getParkStore, getStaff, getGoods } from '@api/editCustomer'
...@@ -256,7 +257,7 @@ export default { ...@@ -256,7 +257,7 @@ export default {
// label: '手机号码', // label: '手机号码',
// prop: 'customerPhone', // prop: 'customerPhone',
// width: '100px' // width: '100px'
// }, // },
{ {
label: '品牌车型', label: '品牌车型',
prop: 'carTypeStr', prop: 'carTypeStr',
...@@ -265,7 +266,7 @@ export default { ...@@ -265,7 +266,7 @@ export default {
// { // {
// label: '车架号', // label: '车架号',
// prop: 'standNo' // prop: 'standNo'
// }, // },
{ {
label: '钥匙号', label: '钥匙号',
prop: 'carKeyNo' prop: 'carKeyNo'
...@@ -321,7 +322,7 @@ export default { ...@@ -321,7 +322,7 @@ export default {
...mapActions({ close: 'd2admin/page/close' }), ...mapActions({ close: 'd2admin/page/close' }),
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.tableSearchForm = _.cloneDeep(this.searchForm) this.tableSearchForm = deepClone(this.searchForm)
!this.userInfo.beSuper && (this.tableSearchForm.yqMerchantId = this.userInfo.detail.merchantId) !this.userInfo.beSuper && (this.tableSearchForm.yqMerchantId = this.userInfo.detail.merchantId)
if (this.tableSearchForm.entryTime) { if (this.tableSearchForm.entryTime) {
this.tableSearchForm.startDate = new Date(this.tableSearchForm.entryTime[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' this.tableSearchForm.startDate = new Date(this.tableSearchForm.entryTime[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
......
<!-- 提现记录 --> <!-- 提现记录 -->
<template> <template>
<d2-container class="account-record"> <d2-container class="account-record">
<div <div class="header"
class="header" slot="header">
slot="header" <d2-search ref="showSearch"
> class="show-search"
<d2-search :search-form="searchForm"
ref="showSearch" :form-data="showFormData" />
class="show-search"
:search-form="searchForm"
:form-data="showFormData"
/>
<div class="up-btns"> <div class="up-btns">
<el-button <el-button :id="tableParams.btnId"
:id="tableParams.btnId" size="small"
size="small" type="primary">
type="primary" 查询
>
查询
</el-button> </el-button>
<el-button <el-button size="small"
size="small" @click="handleReset">
@click="handleReset" 重置
>
重置
</el-button> </el-button>
</div> </div>
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table-header :left-span="24"> <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-header>
<d2-table <d2-table ref="accountRecordTable"
ref="accountRecordTable" :get-list-api="getListApi"
:get-list-api="getListApi" :search-form="searchFormSearch"
:search-form="searchFormSearch" :table-params="tableParams"
:table-params="tableParams" :before-search-fn="beforeSearchFn">
:before-search-fn="beforeSearchFn" <auth-button slot="auth-button"
> slot-scope="scope"
<auth-button :data="scope.scope" />
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
/>
</d2-table> </d2-table>
</div> </div>
</d2-container> </d2-container>
</template> </template>
<script> <script>
import { Util } from '@/common/util' import { Util, deepClone } from '@/common/util'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { BaseData, getCurrentSixMonth, withdrawStatusList, withdrawChannelList } from '@/common/constants.js' import { BaseData, getCurrentSixMonth, withdrawStatusList, withdrawChannelList } from '@/common/constants.js'
import { getWithdrawList, getWithdrawCountApi } from '@/api/account' import { getWithdrawList, getWithdrawCountApi } from '@/api/account'
...@@ -210,7 +199,7 @@ export default { ...@@ -210,7 +199,7 @@ export default {
}, },
getParams() { getParams() {
var params = _.cloneDeep(this.searchForm) var params = deepClone(this.searchForm)
if (params.withDrawDate && params.withDrawDate.length) { if (params.withDrawDate && params.withDrawDate.length) {
params.startDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[0]), 'YYYY-MM-DD') params.startDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[0]), 'YYYY-MM-DD')
params.endDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[1]), 'YYYY-MM-DD') params.endDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[1]), 'YYYY-MM-DD')
......
...@@ -160,15 +160,15 @@ ...@@ -160,15 +160,15 @@
</template> </template>
<script> <script>
import _ from 'lodash' // import _ from 'lodash'
import { Util } from '@/common/util' import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { getParkStore } from '@api/editCustomer' import { getParkStore } from '@api/editCustomer'
// exportApi // exportApi
import { getListApi, getCountApi } from '@/api/account' import { getListApi, getCountApi } from '@/api/account'
import { getPlatformMerchantList } from '@api/index' import { getPlatformMerchantList } from '@api/index'
import { orderTypeList } from '@/common/constants.js' import { orderTypeList } from '@/common/constants.js'
import { asyncExportExcel } from '@api/sys.base' // import { asyncExportExcel } from '@api/sys.base'
export default { export default {
name: 'OfflineAccountList', name: 'OfflineAccountList',
data() { data() {
...@@ -245,7 +245,7 @@ export default { ...@@ -245,7 +245,7 @@ export default {
total: 0, total: 0,
baseData: { baseData: {
parkServiceList: [], parkServiceList: [],
orderTypeList: _.cloneDeep(orderTypeList), orderTypeList: deepClone(orderTypeList),
PlatformMerchantList: [] PlatformMerchantList: []
} }
} }
...@@ -313,7 +313,7 @@ export default { ...@@ -313,7 +313,7 @@ export default {
}, },
getParams() { getParams() {
var params = _.cloneDeep(this.searchForm) var params = deepClone(this.searchForm)
const tempParams = this.getSelectInputParams() const tempParams = this.getSelectInputParams()
params = { params = {
...params, ...params,
......
...@@ -179,14 +179,15 @@ ...@@ -179,14 +179,15 @@
<script> <script>
// exportApi // exportApi
import _ from 'lodash' // import _ from 'lodash'
import { Util } from '@/common/util'
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { getParkStore } from '@api/editCustomer' import { getParkStore } from '@api/editCustomer'
import { divisionStatusList, orderTypeList } from '@/common/constants.js' import { divisionStatusList, orderTypeList } from '@/common/constants.js'
import { getListApi, getCountApi } from '@/api/account' import { getListApi, getCountApi } from '@/api/account'
import { getPlatformMerchantList } from '@api/index' import { getPlatformMerchantList } from '@api/index'
import { asyncExportExcel } from '@api/sys.base' // import { asyncExportExcel } from '@api/sys.base'
export default { export default {
name: 'OnlineAccountList', name: 'OnlineAccountList',
data() { data() {
...@@ -293,8 +294,8 @@ export default { ...@@ -293,8 +294,8 @@ export default {
total: 0, total: 0,
baseData: { baseData: {
parkServiceList: [], parkServiceList: [],
divisionStatusList: _.cloneDeep(divisionStatusList), divisionStatusList: deepClone(divisionStatusList),
orderTypeList: _.cloneDeep(orderTypeList), orderTypeList: deepClone(orderTypeList),
PlatformMerchantList: [] PlatformMerchantList: []
} }
} }
...@@ -363,7 +364,7 @@ export default { ...@@ -363,7 +364,7 @@ export default {
}, },
getParams() { getParams() {
var params = _.cloneDeep(this.searchForm) var params = deepClone(this.searchForm)
const tempParams = this.getSelectInputParams() const tempParams = this.getSelectInputParams()
// console.log(tempParams) // console.log(tempParams)
params = { params = {
......
<!-- 我的分账-提现记录 --> <!-- 我的分账-提现记录 -->
<template> <template>
<d2-container class="my-account-record"> <d2-container class="my-account-record">
<div <div class="header"
class="header" slot="header">
slot="header" <d2-search ref="showSearch"
> :search-form="searchForm"
<d2-search :form-data="showFormData" />
ref="showSearch"
:search-form="searchForm"
:form-data="showFormData"
/>
<div class="up-btns"> <div class="up-btns">
<el-button <el-button :id="tableParams.btnId"
:id="tableParams.btnId" size="small"
size="small" type="primary">
type="primary" 查询
>
查询
</el-button> </el-button>
<el-button <el-button size="small"
size="small" @click="handleReset">
@click="handleReset" 重置
>
重置
</el-button> </el-button>
</div> </div>
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table-header :left-span="24"> <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-header>
<d2-table <d2-table ref="merchantTable"
ref="merchantTable" :get-list-api="getListApi"
:get-list-api="getListApi" :search-form="searchFormSearch"
:search-form="searchFormSearch" :table-params="tableParams"
:table-params="tableParams" :before-search-fn="beforeSearchFn" />
:before-search-fn="beforeSearchFn"
/>
</div> </div>
</d2-container> </d2-container>
</template> </template>
<script> <script>
import { Util } from '@/common/util' import { Util, deepClone } from '@/common/util'
import { getWithdrawList, getWithdrawCountApi } from '@/api/account' import { getWithdrawList, getWithdrawCountApi } from '@/api/account'
import { getCurrentSixMonth, withdrawStatusList, withdrawChannelList } from '@/common/constants.js' import { getCurrentSixMonth, withdrawStatusList, withdrawChannelList } from '@/common/constants.js'
export default { export default {
...@@ -171,7 +162,7 @@ export default { ...@@ -171,7 +162,7 @@ export default {
}, },
getParams() { getParams() {
var params = _.cloneDeep(this.searchForm) var params = deepClone(this.searchForm)
if (params.withDrawDate && params.withDrawDate.length) { if (params.withDrawDate && params.withDrawDate.length) {
params.startDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[0]), 'YYYY-MM-DD') params.startDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[0]), 'YYYY-MM-DD')
params.endDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[1]), 'YYYY-MM-DD') params.endDate = Util.dateFormate(this.getMouthLastDate(params.withDrawDate[1]), 'YYYY-MM-DD')
......
...@@ -41,11 +41,11 @@ ...@@ -41,11 +41,11 @@
<script> <script>
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { Util } from '@/common/util' import { Util, deepClone } from '@/common/util'
// import { divisionTypeList } from '@/common/constants.js' // import { divisionTypeList } from '@/common/constants.js'
// getSeviceCountApi, getSeviceListApi, exportSeviceApi,getSeviceExport // getSeviceCountApi, getSeviceListApi, exportSeviceApi,getSeviceExport
import { getPartnerYqListApi, getSeviceList, getSeviceCount } from '@/api/account' import { getPartnerYqListApi, getSeviceList, getSeviceCount } from '@/api/account'
import { asyncExportExcel } from '@api/sys.base' // import { asyncExportExcel } from '@api/sys.base'
export default { export default {
name: 'ServiceOfflineList', name: 'ServiceOfflineList',
data() { data() {
...@@ -209,7 +209,7 @@ export default { ...@@ -209,7 +209,7 @@ export default {
}, },
getParams() { getParams() {
var params = _.cloneDeep(this.searchForm) var params = deepClone(this.searchForm)
const tempParams = this.getSelectInputParams() const tempParams = this.getSelectInputParams()
params = { params = {
...params, ...params,
......
...@@ -85,12 +85,12 @@ ...@@ -85,12 +85,12 @@
<script> <script>
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { Util } from '@/common/util' import { Util, deepClone } from '@/common/util'
import cashDialog from './cashDialog' import cashDialog from './cashDialog'
import { divisionStatusList } from '@/common/constants.js' import { divisionStatusList } from '@/common/constants.js'
// getSeviceExport // getSeviceExport
import { getBankBalanceApi, getPartnerYqListApi, getSeviceList, getSeviceCount } from '@/api/account' import { getBankBalanceApi, getPartnerYqListApi, getSeviceList, getSeviceCount } from '@/api/account'
import { asyncExportExcel } from '@api/sys.base' // import { asyncExportExcel } from '@api/sys.base'
export default { export default {
name: 'ServiceOnlineList', name: 'ServiceOnlineList',
data() { data() {
...@@ -252,7 +252,7 @@ export default { ...@@ -252,7 +252,7 @@ export default {
}, },
baseData: { baseData: {
parkServiceList: [], parkServiceList: [],
divisionStatusList: _.cloneDeep(divisionStatusList) divisionStatusList: deepClone(divisionStatusList)
} }
} }
}, },
...@@ -301,7 +301,7 @@ export default { ...@@ -301,7 +301,7 @@ export default {
}, },
getParams() { getParams() {
var params = _.cloneDeep(this.searchForm) var params = deepClone(this.searchForm)
const tempParams = this.getSelectInputParams() const tempParams = this.getSelectInputParams()
params = { params = {
...params, ...params,
...@@ -380,7 +380,7 @@ export default { ...@@ -380,7 +380,7 @@ export default {
// 提现弹窗 // 提现弹窗
handleCash() { handleCash() {
this.handleCashClose() this.handleCashClose()
Object.assign(this.cashForm, _.cloneDeep(this.withdrawBalanceInfo)) Object.assign(this.cashForm, deepClone(this.withdrawBalanceInfo))
}, },
handleCashClose() { handleCashClose() {
this.cashVisible = !this.cashVisible this.cashVisible = !this.cashVisible
......
...@@ -101,9 +101,10 @@ import { ...@@ -101,9 +101,10 @@ import {
rangePickerOptions rangePickerOptions
} from '@/common/constants.js' } from '@/common/constants.js'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { deepClone } from '@/common/util'
// import * as api from '@api/finance' // import * as api from '@api/finance'
import { getMerchantPageSearch } from '@api/publicAccount' import { getMerchantPageSearch } from '@api/publicAccount'
import { asyncExportExcel } from '@api/sys.base' // import { asyncExportExcel } from '@api/sys.base'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
export default { export default {
name: 'DownloadAccountDialog', name: 'DownloadAccountDialog',
...@@ -268,7 +269,7 @@ export default { ...@@ -268,7 +269,7 @@ export default {
handleAddConfirm() { handleAddConfirm() {
this.$refs.accountForm.validate(valid => { this.$refs.accountForm.validate(valid => {
if (valid) { if (valid) {
var infoForm = _.cloneDeep(this.infoForm) var infoForm = deepClone(this.infoForm)
console.log(infoForm) console.log(infoForm)
var params = {} var params = {}
var merchantList = [] var merchantList = []
......
...@@ -465,6 +465,7 @@ ...@@ -465,6 +465,7 @@
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { deepClone } from '@/common/util'
import { shop4sDeductChargeFlagObj, partnerDeductChargeFlagObj, payType } from '@/common/constants' import { shop4sDeductChargeFlagObj, partnerDeductChargeFlagObj, payType } from '@/common/constants'
export default { export default {
name: 'FinanceDetail', name: 'FinanceDetail',
...@@ -480,7 +481,7 @@ export default { ...@@ -480,7 +481,7 @@ export default {
1: '预录升级', 1: '预录升级',
2: '现场升级' 2: '现场升级'
}, },
payTypeOpts: _.cloneDeep(payType), payTypeOpts: deepClone(payType),
// { // {
// '1': '微信支付', // '1': '微信支付',
......
...@@ -116,10 +116,10 @@ ...@@ -116,10 +116,10 @@
</el-card> </el-card>
<d2-search ref="showSearch" <d2-search ref="showSearch"
class="show-search" class="show-search"
:searchForm="searchForm" :search-form="searchForm"
:searchSelectObj="searchSelectObj" :search-select-obj="searchSelectObj"
:formData="showFormData" :form-data="showFormData"
:labelWidth="'100px'" :label-width="'100px'"
style="background: #fff;"> style="background: #fff;">
<div class="up-btns" <div class="up-btns"
style="bottom:10px; "> style="bottom:10px; ">
...@@ -576,8 +576,8 @@ import { ...@@ -576,8 +576,8 @@ import {
import downloadAccountDialog from './downloadAccountDialog' import downloadAccountDialog from './downloadAccountDialog'
import warehouseDetail from './warehouseDetail' import warehouseDetail from './warehouseDetail'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { asyncExportExcel } from '@api/sys.base' // import { asyncExportExcel } from '@api/sys.base'
import { returnFloat } from '@/common/util' import { returnFloat, deepClone } from '@/common/util'
export default { export default {
name: 'FinanceList', name: 'FinanceList',
components: { components: {
...@@ -667,17 +667,17 @@ export default { ...@@ -667,17 +667,17 @@ export default {
{ {
label: '分账方式', label: '分账方式',
name: 'divisionType', name: 'divisionType',
optionList: _.cloneDeep(divisionTypeList) optionList: deepClone(divisionTypeList)
}, },
{ {
label: '支付方式', label: '支付方式',
name: 'payType', name: 'payType',
optionList: _.cloneDeep(payTypeList) optionList: deepClone(payTypeList)
}, },
{ {
label: '订单类型', label: '订单类型',
name: 'orderType', name: 'orderType',
optionList: _.cloneDeep(orderTypeList) optionList: deepClone(orderTypeList)
} }
], ],
handleSelectChange: value => { handleSelectChange: value => {
...@@ -742,20 +742,20 @@ export default { ...@@ -742,20 +742,20 @@ export default {
baseData: { baseData: {
parkServiceList: [], parkServiceList: [],
storeIdList: [], storeIdList: [],
divisionTypeList: _.cloneDeep(divisionTypeList), divisionTypeList: deepClone(divisionTypeList),
orderTypeList: _.cloneDeep(orderTypeList), orderTypeList: deepClone(orderTypeList),
warehouseStatusList: _.cloneDeep(warehouseStatusList), warehouseStatusList: deepClone(warehouseStatusList),
// sourceChannelTypeList: _.cloneDeep(sourceChannelTypeList), // sourceChannelTypeList: deepClone(sourceChannelTypeList),
manageTypeList: _.cloneDeep(manageTypeList), manageTypeList: deepClone(manageTypeList),
PlatformMerchantList: [], PlatformMerchantList: [],
channelTypeList: [], channelTypeList: []
}, },
total: 0, total: 0,
page: { page: {
currentPage: 1, currentPage: 1,
pageSize: 20 pageSize: 20
}, },
payTypeOpts: _.cloneDeep(payType), payTypeOpts: deepClone(payType),
// { // {
// 1: '微信支付', // 1: '微信支付',
// 2: '4S店支付', // 2: '4S店支付',
...@@ -1035,7 +1035,7 @@ export default { ...@@ -1035,7 +1035,7 @@ export default {
'franchiseeProfitPer', 'franchiseeProfitPer',
'shopProfitPer', 'shopProfitPer',
'yqProfitPer', 'yqProfitPer',
'glProfitPer', 'glProfitPer'
] ]
for (const key in item) { for (const key in item) {
if (moneyLabels.indexOf(key) > -1) { if (moneyLabels.indexOf(key) > -1) {
......
...@@ -447,7 +447,8 @@ import { mapActions, mapState } from 'vuex' ...@@ -447,7 +447,8 @@ import { mapActions, mapState } from 'vuex'
// import { mapActions } from 'vuex' // import { mapActions } from 'vuex'
import { divisionTypeList, payTypeList, payType } from '@/common/constants.js' import { divisionTypeList, payTypeList, payType } from '@/common/constants.js'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { asyncExportExcel } from '@api/sys.base' import { deepClone } from '@/common/util'
// import { asyncExportExcel } from '@api/sys.base'
export default { export default {
name: 'ServiceFinanceList', name: 'ServiceFinanceList',
data() { data() {
...@@ -519,11 +520,11 @@ export default { ...@@ -519,11 +520,11 @@ export default {
selectOption: [{ selectOption: [{
label: '分账方式', label: '分账方式',
name: 'divisionType', name: 'divisionType',
optionList: _.cloneDeep(divisionTypeList) optionList: deepClone(divisionTypeList)
}, { }, {
label: '支付方式', label: '支付方式',
name: 'payType', name: 'payType',
optionList: _.cloneDeep(payTypeList) optionList: deepClone(payTypeList)
}], }],
handleSelectChange: (value) => { handleSelectChange: (value) => {
this.searchSelectObj.typeSelect.value = '' this.searchSelectObj.typeSelect.value = ''
...@@ -546,7 +547,7 @@ export default { ...@@ -546,7 +547,7 @@ export default {
baseData: { baseData: {
parkServiceList: [], parkServiceList: [],
storeIdList: [], storeIdList: [],
divisionTypeList: _.cloneDeep(divisionTypeList) divisionTypeList: deepClone(divisionTypeList)
}, },
// 服务商 - 查看详情 // 服务商 - 查看详情
serviceVisible: false, serviceVisible: false,
...@@ -556,7 +557,7 @@ export default { ...@@ -556,7 +557,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 20 pageSize: 20
}, },
payTypeOpts: _.cloneDeep(payType), payTypeOpts: deepClone(payType),
// { // {
// '1': '微信支付', // '1': '微信支付',
// '2': '4S店支付', // '2': '4S店支付',
......
<!-- 领用详情 --> <!-- 领用详情 -->
<template> <template>
<div class="couponsDetail"> <div class="couponsDetail">
<d2-table <d2-table ref="couponsDetailTable"
ref="couponsDetailTable" :has-num="false"
:has-num="false" :base-data="baseData"
:base-data="baseData" :sort-obj="sortObj"
:sort-obj="sortObj" :search-form="searchFormSearch"
:search-form="searchFormSearch" :head-search-form="searchForm"
:head-search-form="searchForm" :table-params="tableParams"
:table-params="tableParams" :get-list-api="getListApi"
:get-list-api="getListApi" :before-search-fn="beforeSearchFn"
:before-search-fn="beforeSearchFn" @handleTableHeadChange="handleTableHeadChange">
@handleTableHeadChange="handleTableHeadChange" <span slot="couponName"
> slot-scope="scope">{{ scope.scope.couponName }}{{ scope.scope.customerCouponCode }}</span>
<span
slot="couponName"
slot-scope="scope"
>{{ scope.scope.couponName }}{{ scope.scope.customerCouponCode }}</span>
</d2-table> </d2-table>
</div> </div>
</template> </template>
<script> <script>
import { getDetailList, getDistinctColum } from '@api/coupons' import { getDetailList, getDistinctColum } from '@api/coupons'
import { Util } from '@/common/util' import { Util, deepClone } from '@/common/util'
export default { export default {
name: 'CouponsDetail', name: 'CouponsDetail',
data() { data() {
...@@ -158,7 +154,7 @@ export default { ...@@ -158,7 +154,7 @@ export default {
}, },
// 表格头部搜索-改变 // 表格头部搜索-改变
handleTableHeadChange({ searchItemName, checkedList }) { handleTableHeadChange({ searchItemName, checkedList }) {
this.searchForm[searchItemName] = _.cloneDeep(checkedList) this.searchForm[searchItemName] = deepClone(checkedList)
this.keyDowmGetList() this.keyDowmGetList()
}, },
beforeSearchFn() { beforeSearchFn() {
......
<!-- 发券宝 - 店里列表 --> <!-- 发券宝 - 店里列表 -->
<template> <template>
<div class="coupons"> <div class="coupons">
<d2-table <d2-table ref="couponsTable"
ref="couponsTable" :has-num="false"
:has-num="false" :base-data="baseData"
:base-data="baseData" :sort-obj="sortObj"
:sort-obj="sortObj" :search-form="searchFormSearch"
:search-form="searchFormSearch" :head-search-form="searchForm"
:head-search-form="searchForm" :table-params="tableParams"
:table-params="tableParams" :get-list-api="getListApi"
:get-list-api="getListApi" :before-search-fn="beforeSearchFn"
:before-search-fn="beforeSearchFn" @handleTableHeadChange="handleTableHeadChange">
@handleTableHeadChange="handleTableHeadChange" <template slot="auth-button"
> slot-scope="scope">
<template
slot="auth-button"
slot-scope="scope"
>
<auth-button :data="scope.scope" /> <auth-button :data="scope.scope" />
</template> </template>
</d2-table> </d2-table>
<edit-coupons-dialog <edit-coupons-dialog :coupons-visible="couponsVisible"
:coupons-visible="couponsVisible" :coupon-info="couponInfo"
:coupon-info="couponInfo" @couponClose="couponClose" />
@couponClose="couponClose"
/>
</div> </div>
</template> </template>
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { BaseData } from '@/common/constants.js' import { BaseData } from '@/common/constants.js'
import { deepClone } from '@/common/util'
import editCouponsDialog from './editCouponsDialog' import editCouponsDialog from './editCouponsDialog'
import { getList, deleteCouponApi, updateCouponApi } from '@api/coupons' import { getList, deleteCouponApi, updateCouponApi } from '@api/coupons'
import { commonConfigApi } from '@api/sys.base' import { commonConfigApi } from '@api/sys.base'
...@@ -172,8 +167,8 @@ export default { ...@@ -172,8 +167,8 @@ export default {
get: 'd2admin/base/get' get: 'd2admin/base/get'
}), }),
async getBaseData() { async getBaseData() {
// this.tableParams.tableColumns[this.findFormIdx('couponTypeName')].optionList = _.cloneDeep(await this.get(BaseData.productType)) // this.tableParams.tableColumns[this.findFormIdx('couponTypeName')].optionList = deepClone(await this.get(BaseData.productType))
this.baseData.couponTypeList = _.cloneDeep(await this.get(BaseData.productType)) this.baseData.couponTypeList = deepClone(await this.get(BaseData.productType))
this.$nextTick() this.$nextTick()
}, },
getCommonConfig() { getCommonConfig() {
...@@ -203,7 +198,7 @@ export default { ...@@ -203,7 +198,7 @@ export default {
// 表格头部搜索-改变 // 表格头部搜索-改变
handleTableHeadChange({ searchItemName, checkedList }) { handleTableHeadChange({ searchItemName, checkedList }) {
this.searchForm[searchItemName] = _.cloneDeep(checkedList) this.searchForm[searchItemName] = deepClone(checkedList)
this.keyDowmGetList() 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 @@ ...@@ -115,14 +115,16 @@
</template> </template>
<script> <script>
import _ from 'lodash' // import _ from 'lodash'
import { limitPrice } from '@/common/constants' import { deepClone } from '@/common/util'
import { limitPrice, warrantyProList } from '@/common/constants'
// warrantyProList
export default { export default {
name: 'RelateProDialog', name: 'RelateProDialog',
data() { data() {
return { return {
goodVal: {}, goodVal: {},
warrantyProList: [1, 4, 6], warrantyProList: warrantyProList,
proInfo: { proInfo: {
thumbUrl: '', thumbUrl: '',
goodsCode: '', goodsCode: '',
...@@ -196,7 +198,7 @@ export default { ...@@ -196,7 +198,7 @@ export default {
default: () => [] default: () => []
}, },
originProInfo: { originProInfo: {
type: Object, type: [String, Object],
default: () => { } default: () => { }
} }
}, },
...@@ -208,7 +210,7 @@ export default { ...@@ -208,7 +210,7 @@ export default {
confLabel: i 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) !this.proInfo.incentiveType && (this.proInfo.incentiveType = 1)
}, },
...@@ -255,7 +257,7 @@ export default { ...@@ -255,7 +257,7 @@ export default {
handleWarrantyPeriod(newVal) { handleWarrantyPeriod(newVal) {
this.proInfo.warrantyPeriod = limitPrice(newVal, this.oldVal.warrantyPeriod, 2, 1) this.proInfo.warrantyPeriod = limitPrice(newVal, this.oldVal.warrantyPeriod, 2, 1)
this.oldVal.warrantyPeriod = this.proInfo.warrantyPeriod this.oldVal.warrantyPeriod = this.proInfo.warrantyPeriod
}, }
} }
} }
......
<!-- 关联门店弹窗 --> <!-- 关联门店弹窗 -->
<template> <template>
<d2-dialog title="关联门店" <d2-dialog title="统一分配门店"
:is-visible.sync="relateStoreVisible" :is-visible.sync="relateStoreVisible"
width="70%" width="70%"
btn-ok-label="关联" btn-ok-label="关联"
...@@ -8,8 +8,10 @@ ...@@ -8,8 +8,10 @@
@closeDialog="handleRelateStoreClose" @closeDialog="handleRelateStoreClose"
class="relateStore"> class="relateStore">
<slot /> <slot />
<el-row> <el-row class="tableCon">
<el-col :span="12"> <!-- <el-col :span="12"> -->
<div class="tableBox">
<el-table ref="seletingTable" <el-table ref="seletingTable"
:data="selectingData" :data="selectingData"
height="464px" height="464px"
...@@ -54,45 +56,54 @@ ...@@ -54,45 +56,54 @@
:page-size="pageSize" :page-size="pageSize"
layout="total, prev, pager, next" layout="total, prev, pager, next"
:total="total" /> :total="total" />
</el-col> </div>
<el-col :span="12"> <!-- </el-col> -->
<el-table :data="selectedData" <!-- <el-col :span="12"> -->
class="table" <el-table class="tableBox table"
border :data="selectedData"
height="464px"> border
<el-table-column v-if="sourcePage != 'serviceStore'" height="464px">
prop="yqMerchantName" <el-table-column v-if="sourcePage != 'serviceStore'"
label="园区店名称" prop="yqMerchantName"
align="center" /> label="园区店名称"
<el-table-column prop="merchantName" align="center" >
label="4S店名称"
align="center" />
<el-table-column prop="warrantyType"
label="选择质保"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span> <span>{{ scope.row.yqMerchantName }}</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> </template>
</el-table-column> </el-table-column>
<el-table-column label="删除" <el-table-column prop="merchantName"
align="center" label="4S店名称"
width="50px"> align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button class="el-icon-delete" <span>{{ scope.row.merchantName}}</span>
@click="handleDelete(scope.row)"
type="text" />
</template> </template>
</el-table-column> </el-table-column>
</el-table> <!-- <el-table-column prop="warrantyType"
</el-col> 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> </el-row>
</d2-dialog> </d2-dialog>
</template> </template>
...@@ -140,6 +151,10 @@ export default { ...@@ -140,6 +151,10 @@ export default {
storeSearchForm: { storeSearchForm: {
type: Object, type: Object,
default: () => { } default: () => { }
},
selectedSceneCode: {
typeof: Number,
default: () => 0
} }
// 去掉表格中某些字段 // 去掉表格中某些字段
// noTableField: { // noTableField: {
...@@ -166,21 +181,33 @@ export default { ...@@ -166,21 +181,33 @@ export default {
recoverySelection() { recoverySelection() {
var exitIds = this.selectedData.map(item => item.merchantId) var exitIds = this.selectedData.map(item => item.merchantId)
this.selectingData.forEach(item => { this.selectingData.forEach(item => {
item.merchant
exitIds.includes(item.merchantId) && this.$refs.seletingTable.toggleRowSelection(item, true) exitIds.includes(item.merchantId) && this.$refs.seletingTable.toggleRowSelection(item, true)
}) })
}, },
getSelectingList() { getSelectingList() {
this.storeApi({ this.storeApi({
...this.storeSearchForm, ...this.storeSearchForm,
scene: this.selectedSceneCode,
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize pageSize: this.pageSize
}).then(res => { }).then(res => {
this.selectingData = res.list.map(item => { res.list.forEach(val => {
if (!item.warrantyType) { val.merchantId = val.merchant?.merchantId
item.warrantyType = 0 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.total = res.total
this.$nextTick(() => { this.$nextTick(() => {
this.recoverySelection() this.recoverySelection()
...@@ -188,7 +215,6 @@ export default { ...@@ -188,7 +215,6 @@ export default {
}) })
}, },
handleChange(selection, row) { handleChange(selection, row) {
var addOrDelete = !!selection.find(item => item.merchantId === row.merchantId) var addOrDelete = !!selection.find(item => item.merchantId === row.merchantId)
addOrDelete addOrDelete
? this.selectedData.push(row) ? this.selectedData.push(row)
...@@ -207,7 +233,8 @@ export default { ...@@ -207,7 +233,8 @@ export default {
}, },
handleDelete(row) { handleDelete(row) {
this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId) 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) { handleCurrentChange(val) {
this.currentPage = val this.currentPage = val
...@@ -223,11 +250,17 @@ export default { ...@@ -223,11 +250,17 @@ export default {
} }
</script> </script>
<style> <style lang="scss">
.relateStore .table { .relateStore .table {
margin: 0 auto 20px !important; margin: 0 auto 20px !important;
width: 98%; width: 98%;
} }
.relateStore .tableCon {
display: flex;
.tableBox {
flex: 1;
}
}
.service-store .relateStore .el-table .cell, .service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell { .d2-form .relateStore .el-table .cell {
line-height: 26px !important; line-height: 26px !important;
......
...@@ -53,27 +53,27 @@ ...@@ -53,27 +53,27 @@
v-for="(item,index) in commodityInfo.upgradeGoodsList" v-for="(item,index) in commodityInfo.upgradeGoodsList"
:key="index"> :key="index">
<p class="car-sub-head"> <p class="car-sub-head">
商品{{ index + 1 }}-{{ item.goodsInfo.goodsName }} 商品{{ index + 1 }}-{{ item.specificationData ? (item.goodsInfo.goodsName + ' ' + item.specificationData) : item.goodsInfo.goodsName }}
</p> </p>
<!-- <el-form-item class="d2-drawer-item" <!-- <el-form-item class="d2-drawer-item"
label="商品名称:"> label="商品名称:">
<span>{{item.goodsInfo.goodsName}}</span> <span>{{item.goodsInfo.goodsName}}</span>
</el-form-item> --> </el-form-item> -->
<el-form-item class="d2-drawer-item" <el-form-item class="d2-drawer-item"
label="品牌:"> label="品牌方:">
<span>{{ item.goodsInfo.brandMerchantName }}</span> <span>{{ item.goodsInfo.brandMerchantName }}</span>
</el-form-item> </el-form-item>
<el-form-item class="d2-drawer-item" <el-form-item class="d2-drawer-item"
label="分类:"> label="类目:">
<span>{{ item.goodsInfo.goodsTypeName }}</span> <span>{{ item.goodsInfo.goodsTypeName }}</span>
</el-form-item> </el-form-item>
<el-form-item class="d2-drawer-item" <el-form-item class="d2-drawer-item"
label="产品成本:"> label="商品成本:">
<span>{{ item.shopPrice ? (item.shopPrice + '元') : '无' }}</span> <span>{{ item.shopPrice ? (item.shopPrice + '元') : '无' }}</span>
</el-form-item> </el-form-item>
<!-- style="font-weight: bold;" --> <!-- style="font-weight: bold;" -->
<el-form-item class="d2-drawer-item" <el-form-item class="d2-drawer-item"
label="建议升级价:"> label="商品零售价:">
<!-- class="car-strong-txt" --> <!-- class="car-strong-txt" -->
<span>{{ item.upgradePrice }}元</span> <span>{{ item.upgradePrice }}元</span>
</el-form-item> </el-form-item>
...@@ -81,7 +81,17 @@ ...@@ -81,7 +81,17 @@
label="商品最低价:"> label="商品最低价:">
<span>{{ item.shopMinPrice ? (item.shopMinPrice + '元') : '无' }}</span> <span>{{ item.shopMinPrice ? (item.shopMinPrice + '元') : '无' }}</span>
</el-form-item> </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" class="d2-drawer-item"
label="质保年限:"> label="质保年限:">
<span>{{ item.warrantyPeriod ? (item.warrantyPeriod + '年') : '无' }}</span> <span>{{ item.warrantyPeriod ? (item.warrantyPeriod + '年') : '无' }}</span>
...@@ -136,13 +146,13 @@ ...@@ -136,13 +146,13 @@
<el-table-column prop="merchantId" <el-table-column prop="merchantId"
label="商户编号" label="商户编号"
align="center" /> align="center" />
<el-table-column prop="userType" <!-- <el-table-column prop="userType"
label="商户类型" label="商户类型"
align="center"> align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ baseData[scope.row.channelType === 2 ? 'ghUserTypeList' : 'userTypeList'][scope.row.userType] }}</span> <span>{{ baseData[scope.row.channelType === 2 ? 'ghUserTypeList' : 'userTypeList'][scope.row.userType] }}</span>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column prop="warrantyType" <el-table-column prop="warrantyType"
label="质保类型" label="质保类型"
align="center"> align="center">
...@@ -158,13 +168,13 @@ ...@@ -158,13 +168,13 @@
<script> <script>
import { getGoodsInfoById, submitReviewResult } from '@/api/commodity' import { getGoodsInfoById, submitReviewResult } from '@/api/commodity'
import { userType, ghUserType } from '@/common/constants' import { userType, ghUserType, warrantyProList } from '@/common/constants'
export default { export default {
name: 'DrawerDetail', name: 'DrawerDetail',
data() { data() {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
warrantyProList: [1, 4, 6], warrantyProList: warrantyProList,
commodityInfo: { commodityInfo: {
goodsInfo: {} goodsInfo: {}
}, },
...@@ -217,8 +227,11 @@ export default { ...@@ -217,8 +227,11 @@ export default {
getInfo(id) { getInfo(id) {
getGoodsInfoById({ id: id }).then(res => { 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 = 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 @@ ...@@ -6,6 +6,7 @@
<d2-search ref="showSearch" <d2-search ref="showSearch"
class="show-search" class="show-search"
:search-form="searchForm" :search-form="searchForm"
@handleChangeSelect="handleChangeSelect"
:form-data="showFormData"> :form-data="showFormData">
<!-- <p> <!-- <p>
<el-input <el-input
...@@ -34,21 +35,23 @@ ...@@ -34,21 +35,23 @@
<span slot="left"> <span slot="left">
<auth-button category="Button" <auth-button category="Button"
style="{display: inline-block}" style="{display: inline-block}"
show-btn-ids="['9030101']" /> :show-btn-ids="['9030101']" />
</span> </span>
<auth-button category="Button" <auth-button category="Button"
style="{display: inline-block}" style="{display: inline-block}"
show-btn-ids="['9030103']" /> :show-btn-ids="['9030103']" />
</d2-table-header> </d2-table-header>
<d2-table ref="productTable" <d2-table ref="productTable"
:search-form="searchForm" :search-form="searchForm"
:table-params="tableParams" :table-params="tableParams"
:get-list-api="getListApi" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn"> :before-search-fn="beforeSearchFn">
<img slot="img" <div class="material" slot="img" slot-scope="scope">
slot-scope="scope" <img
class="pro-img" class="pro-img"
:src="scope.scope.thumbUrl"> :src="scope.scope.thumbUrl">
<span class="good_name">{{scope.scope.goodsName}}</span>
</div>
<auth-button slot="auth-button" <auth-button slot="auth-button"
slot-scope="scope" slot-scope="scope"
:data="scope.scope" /> :data="scope.scope" />
...@@ -58,11 +61,12 @@ ...@@ -58,11 +61,12 @@
</template> </template>
<script> <script>
import _ from 'lodash' // import _ from 'lodash'
import { deepClone } from '@/common/util'
// exportGoodsList // exportGoodsList
import { getList, deleteGoods, checkDeleteGoods } from '@api/product' import { getList, deleteGoods, checkDeleteGoods, getProductTypeBySceneId } from '@api/product'
import { BaseData, brandMerchantList } from '@/common/constants.js' import { BaseData, brandMerchantList, scenCodeList } from '@/common/constants.js'
import { asyncExportExcel } from '@api/sys.base' // import { asyncExportExcel } from '@api/sys.base'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
// import { exportJsonToExcel } from '@/common/Export2Excel.js' // import { exportJsonToExcel } from '@/common/Export2Excel.js'
export default { export default {
...@@ -70,11 +74,12 @@ export default { ...@@ -70,11 +74,12 @@ export default {
data() { data() {
return { return {
searchForm: { searchForm: {
// goodsName: '', goodsName: '',
goodsType: '', goodsType: '',
brandMerchantCode: '', sceneType: ''
// brandMerchantCode: '',
// status: '', // status: '',
createTime: '' // createTime: ''
}, },
showFormData: [ showFormData: [
// { // {
...@@ -83,23 +88,46 @@ export default { ...@@ -83,23 +88,46 @@ export default {
// type: 'input' // type: 'input'
// }, // },
{ {
label: '分类', label: '素材名',
name: 'goodsType', name: 'goodsName',
type: 'select', type: 'input',
optionList: [], isClear: true,
optionId: 'goodsType', keyFn: this.keyDowmGetList
optionLabel: 'goodsTypeName',
optionsName: 'productTypeList'
}, { }, {
label: '品牌商', label: '所属场景',
name: 'brandMerchantCode', name: 'sceneType',
type: 'select', type: 'select',
optionList: [], optionList: [],
optionId: 'confId', optionId: 'confId',
optionLabel: 'confValue', 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: '状态', // label: '状态',
// name: 'status', // name: 'status',
// type: 'select', // type: 'select',
...@@ -108,19 +136,14 @@ export default { ...@@ -108,19 +136,14 @@ export default {
// optionLabel: 'confValue', // optionLabel: 'confValue',
// optionsName: 'statusList' // optionsName: 'statusList'
// }, // },
{ // {
label: '创建时间', // label: '创建时间',
name: 'createTime', // name: 'createTime',
type: 'datePicker', // type: 'datePicker',
isClear: true, // isClear: true,
pickerOptions: 'rangePickerOptions' // pickerOptions: 'rangePickerOptions'
}, { // }
label: '素材名称', ],
name: 'goodsName',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}],
getListApi: getList, getListApi: getList,
// 表格参数 // 表格参数
tableParams: { tableParams: {
...@@ -128,31 +151,38 @@ export default { ...@@ -128,31 +151,38 @@ export default {
listName: 'list', listName: 'list',
tableOption: true, tableOption: true,
tableColumns: [{ tableColumns: [{
label: '缩略图', label: '素材名',
prop: 'thumbUrl', prop: 'goodsName',
addHtml: 'img' addHtml: 'img'
}, { }, {
label: '素材名称', label: '类目',
prop: 'goodsName'
}, {
label: '素材ID',
prop: 'id'
}, {
label: '分类',
prop: 'goodsTypeName' prop: 'goodsTypeName'
}, { }, {
label: '品牌商', label: '所属场景',
prop: 'brandMerchantName' prop: 'sceneName'
}, { },
label: '创建时间', // {
// label: '素材ID',
// prop: 'id'
// }, {
// label: '分类',
// prop: 'goodsTypeName'
// }, {
// label: '品牌商',
// prop: 'brandMerchantName'
// },
{
label: '创建日期',
prop: 'createDateStr' prop: 'createDateStr'
}, { }
label: '状态', // {
prop: 'status', // label: '状态',
formatter: (cellValue) => { // prop: 'status',
return this.baseData.statusList.find(item => item.confId === cellValue.status).confValue // formatter: (cellValue) => {
} // return this.baseData.statusList.find(item => item.confId === cellValue.status).confValue
}] // }
// }
]
}, },
// 查看门店 // 查看门店
detailVisible: false, detailVisible: false,
...@@ -166,7 +196,8 @@ export default { ...@@ -166,7 +196,8 @@ export default {
}, { }, {
confId: 1, confId: 1,
confValue: '使用' confValue: '使用'
}] }],
scenCodeList: []
} }
} }
}, },
...@@ -178,11 +209,18 @@ export default { ...@@ -178,11 +209,18 @@ export default {
}, },
mounted() { mounted() {
this.baseData.brandList = _.cloneDeep(brandMerchantList) this.baseData.brandList = deepClone(brandMerchantList)
this.baseData.scenCodeList = deepClone(scenCodeList)
var allOpt = { confId: '', confValue: '全部' } var allOpt = { confId: '', confValue: '全部' }
this.baseData.brandList.unshift(allOpt) this.baseData.brandList.unshift(allOpt)
this.baseData.statusList.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: { methods: {
...@@ -192,10 +230,10 @@ export default { ...@@ -192,10 +230,10 @@ export default {
close: 'd2admin/page/close' close: 'd2admin/page/close'
}), }),
async getBaseData() { async getBaseData() {
this.baseData.productTypeList = _.cloneDeep(await this.get(BaseData.productType)) // this.baseData.productTypeList = deepClone(await this.get(BaseData.productType))
this.baseData.productTypeList.unshift({ this.baseData.productTypeList.unshift({
goodsType: '', id: '',
goodsTypeName: '全部' categoryName: '全部'
}) })
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === 'select') {
...@@ -207,23 +245,34 @@ export default { ...@@ -207,23 +245,34 @@ export default {
this.$refs.productTable.refreshTable() this.$refs.productTable.refreshTable()
}, },
// 根据所选场景获取类目
handleChangeSelect(value) {
getProductTypeBySceneId({ sceneType: value }).then(res => {
this.baseData.productTypeList = res
this.getBaseData()
})
},
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
if (this.searchForm.createTime) { // if (this.searchForm.createTime) {
this.searchForm.startDate = new Date(this.searchForm.createTime[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' // 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' // this.searchForm.endDate = new Date(this.searchForm.createTime[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} else { // } else {
this.searchForm.startDate = '' // this.searchForm.startDate = ''
this.searchForm.endDate = '' // this.searchForm.endDate = ''
} // }
resolve() resolve()
}) })
}, },
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
goodsType: '', goodsType: '',
brandMerchantCode: '' // brandMerchantCode: ''
// status: '' // status: ''
goodsName: '',
sceneType: '',
} }
}, },
handleAdd(form) { handleAdd(form) {
...@@ -315,13 +364,24 @@ export default { ...@@ -315,13 +364,24 @@ export default {
} }
</script> </script>
<style scoped>
.material{
padding: 0 60px;
display: flex;
justify-content: left;
align-items: center;
}
.good_name{
margin-left: 20px;
}
</style>
<style> <style>
.product { .product {
position: relative; position: relative;
} }
.product .pro-img { .product .pro-img {
width: 80px; width: 36px;
height: 80px; height: 36px;
} }
.product p { .product p {
margin: 0; margin: 0;
......
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
import { getMerchantPageSearch } from '../../api/publicAccount' import { getMerchantPageSearch } from '../../api/publicAccount'
import { pushObject, addContact, modifyContact, importContact, removeContact } from '../../api/merchant' import { pushObject, addContact, modifyContact, importContact, removeContact } from '../../api/merchant'
import { mapActions, mapState, mapMutations } from 'vuex' import { mapActions, mapState, mapMutations } from 'vuex'
import { deepClone } from '@/common/util'
const state = [ const state = [
{ {
value: 1, value: 1,
...@@ -217,13 +217,13 @@ export default { ...@@ -217,13 +217,13 @@ export default {
merchantName: [{ required: true, message: '请选择商户', trigger: 'change' }], merchantName: [{ required: true, message: '请选择商户', trigger: 'change' }],
name: [{ required: true, message: '请输入姓名', trigger: 'change' }], name: [{ required: true, message: '请输入姓名', trigger: 'change' }],
phone: [{ required: true, message: '请输入手机号', trigger: 'change' }, phone: [{ required: true, message: '请输入手机号', trigger: 'change' },
{ {
validator: (rule, value, callback) => { 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}$/ 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('请输入正确的联系号码')) return phoneReg.test(value) ? callback() : callback(new Error('请输入正确的联系号码'))
}, },
trigger: 'change' trigger: 'change'
} }
] ]
}, },
fileRules: { fileRules: {
...@@ -272,7 +272,7 @@ export default { ...@@ -272,7 +272,7 @@ export default {
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.tableSearchForm = _.cloneDeep(this.searchForm) this.tableSearchForm = deepClone(this.searchForm)
resolve() resolve()
}) })
}, },
......
...@@ -214,6 +214,7 @@ ...@@ -214,6 +214,7 @@
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import signRefundDialog from './signRefundDialog' import signRefundDialog from './signRefundDialog'
import { deepClone } from '@/common/util'
import { payType } from '@/common/constants.js' import { payType } from '@/common/constants.js'
// import { getOrderDetail } from '@api/order' // import { getOrderDetail } from '@api/order'
import dayjs from 'dayjs' import dayjs from 'dayjs'
...@@ -246,7 +247,7 @@ export default { ...@@ -246,7 +247,7 @@ export default {
1: '未支付', 1: '未支付',
2: '已支付' 2: '已支付'
}, },
payTypeOpts: _.cloneDeep(payType), payTypeOpts: deepClone(payType),
// { // {
// '1': '微信支付', // '1': '微信支付',
// '2': '4S店支付', // '2': '4S店支付',
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
slot="header"> slot="header">
<d2-search ref="showSearch" <d2-search ref="showSearch"
class="show-search" class="show-search"
:searchForm="searchForm" :search-form="searchForm"
:labelWidth="'100px'" :label-width="'100px'"
:formData="showFormData"></d2-search> :form-data="showFormData" />
<div class="up-btns"> <div class="up-btns">
<el-button @click="handleSearch" <el-button @click="handleSearch"
size="small" size="small"
...@@ -253,11 +253,11 @@ ...@@ -253,11 +253,11 @@
<script> <script>
import { Util } from '@/common/util' import { Util } from '@/common/util'
import { getList, exportFile, getOrderCount, waitinputorderCount, orderImport } from '@api/order' import { getList, getOrderCount, waitinputorderCount, orderImport } from '@api/order'
import { sourceChannelTypeList, manageTypeList, BaseData } from '@/common/constants' import { manageTypeList, BaseData } from '@/common/constants'
import { mapActions, mapState, mapMutations } from 'vuex' import { mapActions, mapState, mapMutations } from 'vuex'
import { getServiceStore, getParkStore } from '@api/editCustomer' import { getServiceStore, getParkStore } from '@api/editCustomer'
import { asyncExportExcel } from '@api/sys.base' // import { asyncExportExcel } from '@api/sys.base'
export default { export default {
name: 'OrderList', name: 'OrderList',
data() { data() {
...@@ -469,7 +469,7 @@ export default { ...@@ -469,7 +469,7 @@ export default {
parkServiceList: [], parkServiceList: [],
storeIdList: [], storeIdList: [],
// sourceChannelTypeList: _.cloneDeep(sourceChannelTypeList), // sourceChannelTypeList: _.cloneDeep(sourceChannelTypeList),
manageTypeList: _.cloneDeep(manageTypeList), manageTypeList: Util.deepClone(manageTypeList),
sourceList: [ sourceList: [
{ {
confId: '1', confId: '1',
...@@ -480,7 +480,7 @@ export default { ...@@ -480,7 +480,7 @@ export default {
confLabel: '系统导入' confLabel: '系统导入'
} }
], ],
channelTypeList: [], channelTypeList: []
}, },
tableData: [], tableData: [],
total: 0, total: 0,
...@@ -649,7 +649,7 @@ export default { ...@@ -649,7 +649,7 @@ export default {
}) })
}, },
getParams() { getParams() {
const params = _.cloneDeep(this.searchForm) const params = Util.deepClone(this.searchForm)
const form = this.searchForm const form = this.searchForm
if (form.orderTime && form.orderTime.length) { if (form.orderTime && form.orderTime.length) {
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
:search-form="searchFormSearch" :search-form="searchFormSearch"
:table-params="tableParams" :table-params="tableParams"
:before-search-fn="beforeSearchFn" :before-search-fn="beforeSearchFn"
:selectableFn="selectableFn"> :selectable-fn="selectableFn">
<template slot="auth-button" <template slot="auth-button"
slot-scope="scope"> slot-scope="scope">
<el-button type="text" <el-button type="text"
...@@ -70,24 +70,21 @@ ...@@ -70,24 +70,21 @@
</div> </div>
</d2-container> </d2-container>
<!-- 批量修改所属园区店 --> <!-- 批量修改所属园区店 -->
<update-yqMerchant-dialog :merchantVisible="merchantDialogVisible" <update-yqMerchant-dialog :merchant-visible="merchantDialogVisible"
:idList="ids" :id-list="ids"
v-if="merchantDialogVisible" v-if="merchantDialogVisible"
@dialogClose="dialogClose" /> @dialogClose="dialogClose" />
</div> </div>
</template> </template>
<script> <script>
import { Util } from '@/common/util' import { Util, deepClone } from '@/common/util'
import _ from 'lodash'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { getParkStore } from '@api/editCustomer' import { getParkStore } from '@api/editCustomer'
// waitinputorderExport
import { payTypeList } from '@/common/constants.js' import { payTypeList } from '@/common/constants.js'
import { waitinputorderCount, waitinputorderPage, getList, markAsNoUse } from '@api/order' import { waitinputorderCount, waitinputorderPage, getList, markAsNoUse } from '@api/order'
// import { asyncExportExcel } from '@api/sys.base'
import updateYqMerchantDialog from './updateYqMerchantDialog' import updateYqMerchantDialog from './updateYqMerchantDialog'
const clonePayTypeList = _.cloneDeep(payTypeList) const clonePayTypeList = deepClone(payTypeList)
clonePayTypeList.splice(1, 1) clonePayTypeList.splice(1, 1)
export default { export default {
name: 'OrderSupplement', name: 'OrderSupplement',
...@@ -305,7 +302,7 @@ export default { ...@@ -305,7 +302,7 @@ export default {
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.searchFormSearch = _.cloneDeep(this.searchForm) this.searchFormSearch = deepClone(this.searchForm)
if (this.searchFormSearch.payDate) { if (this.searchFormSearch.payDate) {
this.searchFormSearch.accountStartDate = Util.dateFormate(this.searchFormSearch.payDate[0], 'YYYY-MM-DD HH:mm:ss') 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' this.searchFormSearch.accountEndDate = Util.dateFormate(this.searchFormSearch.payDate[1], 'YYYY-MM-DD') + ' 23:59:59'
...@@ -411,7 +408,7 @@ export default { ...@@ -411,7 +408,7 @@ export default {
selectableFn(row, index) { selectableFn(row, index) {
var isSelect = true var isSelect = true
if (row.inputStatus == '1') {//已补录流水不可勾选 if (row.inputStatus == '1') { // 已补录流水不可勾选
isSelect = false isSelect = false
} }
return isSelect return isSelect
...@@ -419,9 +416,9 @@ export default { ...@@ -419,9 +416,9 @@ export default {
batchUpdateYqMerchant() { batchUpdateYqMerchant() {
var selectedData = [] var selectedData = []
console.log(this.$refs.recordTable.mutiSelectArr['orderSupplement']); console.log(this.$refs.recordTable.mutiSelectArr.orderSupplement)
if (this.$refs.recordTable.mutiSelectArr['orderSupplement']) { if (this.$refs.recordTable.mutiSelectArr.orderSupplement) {
selectedData = this.$refs.recordTable.mutiSelectArr['orderSupplement'] selectedData = this.$refs.recordTable.mutiSelectArr.orderSupplement
} }
if (!selectedData.length) { if (!selectedData.length) {
this.$message({ this.$message({
...@@ -446,9 +443,9 @@ export default { ...@@ -446,9 +443,9 @@ export default {
batchMarkAsNoUse() { batchMarkAsNoUse() {
var selectedData = [] var selectedData = []
console.log(this.$refs.recordTable.mutiSelectArr['orderSupplement']); console.log(this.$refs.recordTable.mutiSelectArr.orderSupplement)
if (this.$refs.recordTable.mutiSelectArr['orderSupplement']) { if (this.$refs.recordTable.mutiSelectArr.orderSupplement) {
selectedData = this.$refs.recordTable.mutiSelectArr['orderSupplement'] selectedData = this.$refs.recordTable.mutiSelectArr.orderSupplement
} }
if (!selectedData.length) { if (!selectedData.length) {
this.$message({ this.$message({
......
<!-- 下载对账单 --> <!-- 下载对账单 -->
<template> <template>
<d2-dialog <d2-dialog title="退款备注"
title="退款备注" :is-visible="signRefundVisible"
:is-visible="signRefundVisible" class="accountDailog"
class="accountDailog" @closeDialog="handleClose"
@closeDialog="handleClose" @confirmDialog="handleAddConfirm">
@confirmDialog="handleAddConfirm" <el-form ref="refundForm"
> :model="infoForm"
<el-form :rules="formRules">
ref="refundForm"
:model="infoForm"
:rules="formRules"
>
<el-form-item prop="remark"> <el-form-item prop="remark">
<el-input <el-input v-clear-emoij
v-clear-emoij type="textarea"
type="textarea" :rows="5"
:rows="5" placeholder="不超过100个字。"
placeholder="不超过100个字。" maxlength="100"
maxlength="100" show-word-limit
show-word-limit v-model="infoForm.remark" />
v-model="infoForm.remark"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
</d2-dialog> </d2-dialog>
...@@ -30,6 +24,7 @@ ...@@ -30,6 +24,7 @@
<script> <script>
// import { getMerchantPageSearch } from '@api/publicAccount' // import { getMerchantPageSearch } from '@api/publicAccount'
import { markAsRefunded } from '@api/order' import { markAsRefunded } from '@api/order'
import { deepClone } from '@/common/util'
export default { export default {
name: 'SignRefundDialog', name: 'SignRefundDialog',
data() { data() {
...@@ -72,7 +67,7 @@ export default { ...@@ -72,7 +67,7 @@ export default {
handleAddConfirm() { handleAddConfirm() {
this.$refs.refundForm.validate(valid => { this.$refs.refundForm.validate(valid => {
if (valid) { if (valid) {
var infoForm = _.cloneDeep(this.infoForm) var infoForm = deepClone(this.infoForm)
var params = {} var params = {}
params.refundRemark = infoForm.remark params.refundRemark = infoForm.remark
params.orderCode = this.detail.orderCode params.orderCode = this.detail.orderCode
......
...@@ -29,14 +29,15 @@ ...@@ -29,14 +29,15 @@
<script> <script>
import { getParkStore } from '@api/editCustomer' import { getParkStore } from '@api/editCustomer'
import { updateYqMerchant } from '@api/order' import { updateYqMerchant } from '@api/order'
import { deepClone } from '@/common/util'
export default { export default {
name: 'updateYqMerchantDialog', name: 'UpdateYqMerchantDialog',
data() { data() {
return { return {
// userInfo: this.$store.state.d2admin.user.info, // userInfo: this.$store.state.d2admin.user.info,
infoForm: { infoForm: {
yqMerchantId: '', yqMerchantId: '',
idList: [], idList: []
}, },
formRules: { formRules: {
yqMerchantId: [ yqMerchantId: [
...@@ -60,7 +61,7 @@ export default { ...@@ -60,7 +61,7 @@ export default {
idList: { idList: {
type: Array, type: Array,
default: () => { } default: () => { }
}, }
}, },
watch: { watch: {
...@@ -89,7 +90,7 @@ export default { ...@@ -89,7 +90,7 @@ export default {
this.$refs.merchantForm.validate(valid => { this.$refs.merchantForm.validate(valid => {
if (valid) { if (valid) {
this.infoForm.idList = this.idList this.infoForm.idList = this.idList
var params = _.cloneDeep(this.infoForm) var params = deepClone(this.infoForm)
updateYqMerchant(params).then(res => { updateYqMerchant(params).then(res => {
this.notice.okTips() this.notice.okTips()
this.handleClose(true) this.handleClose(true)
......
...@@ -3,67 +3,49 @@ ...@@ -3,67 +3,49 @@
<dialog-reg :is-visible="registerDialogVisible" /> <dialog-reg :is-visible="registerDialogVisible" />
<div class="page-login--layer page-login--layer-area"> <div class="page-login--layer page-login--layer-area">
<ul class="circles"> <ul class="circles">
<li <li v-for="n in 10"
v-for="n in 10" :key="n" />
:key="n"
/>
</ul> </ul>
</div> </div>
<div <div class="page-login--layer page-login--layer-time"
class="page-login--layer page-login--layer-time" flex="main:center cross:center">
flex="main:center cross:center"
>
{{ time }} {{ time }}
</div> </div>
<div class="page-login--layer"> <div class="page-login--layer">
<div <div class="page-login--content"
class="page-login--content" flex="dir:top main:justify cross:stretch box:justify">
flex="dir:top main:justify cross:stretch box:justify"
>
<div class="page-login--content-header"> <div class="page-login--content-header">
<p class="page-login--content-header-motto" /> <p class="page-login--content-header-motto" />
</div> </div>
<div <div class="page-login--content-main"
class="page-login--content-main" flex="dir:top main:center cross:center">
flex="dir:top main:center cross:center"
>
<!-- form --> <!-- form -->
<div <div class="page-login--form-box"
class="page-login--form-box" @click="handleReturnLogin">
@click="handleReturnLogin" <div class="page-login--form"
> v-show="!isMutiAccount">
<div
class="page-login--form"
v-show="!isMutiAccount"
>
<div class="form-left"> <div class="form-left">
<el-form <el-form ref="loginForm"
ref="loginForm" label-position="top"
label-position="top" :rules="rules"
:rules="rules" :model="formLogin"
:model="formLogin" size="default">
size="default"
>
<div class="title-wrap"> <div class="title-wrap">
<!-- <span class="form-title">{{systemName}}</span> --> <!-- <span class="form-title">{{systemName}}</span> -->
<span class="form-title"> <span class="form-title">
<img <img src="./image/title.png"
src="./image/title.png" alt="D+智享车生活">
alt="D+智享车生活"
>
</span> </span>
<span class="form-sub">{{ systemSubName }}</span> <span class="form-sub">{{ systemSubName }}</span>
</div> </div>
<div class="input-wrap"> <div class="input-wrap">
<el-form-item prop="userName"> <el-form-item prop="userName">
<el-input <el-input type="text"
type="text" @keyup.native.13="submit"
@keyup.native.13="submit" v-model="formLogin.userName"
v-model="formLogin.userName" placeholder="用户名"
placeholder="用户名" clearable
clearable v-focus>
v-focus
>
<!-- <d2-el-icon <!-- <d2-el-icon
slot="prepend" slot="prepend"
name="user" name="user"
...@@ -71,13 +53,11 @@ ...@@ -71,13 +53,11 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<el-input <el-input type="password"
type="password" v-model="formLogin.password"
v-model="formLogin.password" @keyup.native.13="submit"
@keyup.native.13="submit" clearable
clearable placeholder="密码">
placeholder="密码"
>
<!-- <d2-el-icon <!-- <d2-el-icon
slot="prepend" slot="prepend"
name="key" name="key"
...@@ -85,21 +65,17 @@ ...@@ -85,21 +65,17 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item class="form-action"> <el-form-item class="form-action">
<el-button <el-button @click="submit"
@click="submit" type="primary"
type="primary" :loading="$store.state.d2admin.loading.value"
:loading="$store.state.d2admin.loading.value" class="button-login"
class="button-login" :style="{'width': hasReg ? '' : '100%' }">
:style="{'width': hasReg ? '' : '100%' }"
>
登录 登录
</el-button> </el-button>
<el-button <el-button v-if="hasReg"
v-if="hasReg" @click.prevent="registerDialogVisible = true"
@click.prevent="registerDialogVisible = true" plain
plain class="button-reg">
class="button-reg"
>
注册 注册
</el-button> </el-button>
</el-form-item> </el-form-item>
...@@ -111,20 +87,16 @@ ...@@ -111,20 +87,16 @@
<div class="img-bg" /> <div class="img-bg" />
</div> </div>
</div> </div>
<div <div class="page-login--muti-form"
class="page-login--muti-form" v-show="isMutiAccount">
v-show="isMutiAccount"
>
<div class="muti-title"> <div class="muti-title">
请选择登陆商户号 请选择登陆商户号
</div> </div>
<div class="muti-form-box"> <div class="muti-form-box">
<div <div class="muti-merchant-item"
class="muti-merchant-item" v-for="(item, index) in accountInfo.accountList"
v-for="(item, index) in accountInfo.accountList" :key="index"
:key="index" @click.stop.prevent="handleSelectAccount(index)">
@click.stop.prevent="handleSelectAccount(index)"
>
<i class="muti-dot" /> <i class="muti-dot" />
<div class="muti-merchant-info"> <div class="muti-merchant-info">
<p class="muti-merchant-name"> <p class="muti-merchant-name">
...@@ -160,12 +132,14 @@ import util from '@/libs/util.js' ...@@ -160,12 +132,14 @@ import util from '@/libs/util.js'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { selectAccount, getUserInfo } from '@api/sys.account' import { selectAccount, getUserInfo } from '@api/sys.account'
import { baseConfig } from '@/main'
export default { export default {
components: { components: {
DialogReg: () => import('./dialogReg') DialogReg: () => import('./dialogReg')
}, },
data() { data() {
return { return {
baseConfig,
registerDialogVisible: false, registerDialogVisible: false,
timeInterval: null, timeInterval: null,
time: dayjs().format('HH:mm:ss'), time: dayjs().format('HH:mm:ss'),
...@@ -558,14 +532,14 @@ export default { ...@@ -558,14 +532,14 @@ export default {
.img-top { .img-top {
width: 320px; width: 320px;
height: 24px; height: 24px;
background: url('./image/bz.png'); background: url("./image/bz.png");
background-size: 320px auto; background-size: 320px auto;
margin-bottom: 53px; margin-bottom: 53px;
transform: translateY(20px); transform: translateY(20px);
} }
.img-bg { .img-bg {
// box-sizing: border-box; // box-sizing: border-box;
background: url('./image/bg.png') no-repeat; background: url("./image/bg.png") no-repeat;
background-size: 320px auto; background-size: 320px auto;
width: 322px; width: 322px;
height: 276px; height: 276px;
......
<!-- 虚拟对公账户详情 --> <!-- 虚拟对公账户详情 -->
<template> <template>
<div class="account-detail"> <div class="account-detail">
<el-form <el-form :model="merchantRow"
:model="merchantRow" label-width="190px">
label-width="190px"
>
<p class="edit-sub-title"> <p class="edit-sub-title">
账户信息 账户信息
</p> </p>
<el-form-item <el-form-item label="客户名称:"
label="客户名称:" prop="name">
prop="name"
>
<span>{{ merchantRow.merchantName }}</span> <span>{{ merchantRow.merchantName }}</span>
</el-form-item> </el-form-item>
<p class="edit-sub-title"> <p class="edit-sub-title">
申请资料 申请资料
</p> </p>
<block <block v-for="(item, index) in formList"
v-for="(item, index) in formList" :key="index">
: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 + ':')"
<el-form-item :prop="item.prop">
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'"> <span v-if="item.type === 'image'">
<img <img v-for="(subItem, subIdx) in item.imgList"
v-for="(subItem, subIdx) in item.imgList" :key="subIdx"
:key="subIdx" class="detail-img"
class="detail-img" :src="detailForm.papersList[imgToAttr[subItem]]">
:src="detailForm.papersList[imgToAttr[subItem]]"
>
</span> </span>
<span v-else-if="item.formatter">{{ item.formatter(item) }}</span> <span v-else-if="item.formatter">{{ item.formatter(item) }}</span>
<span v-else>{{ detailForm[item.prop] }}</span> <span v-else>{{ detailForm[item.prop] }}</span>
...@@ -44,6 +34,7 @@ ...@@ -44,6 +34,7 @@
<script> <script>
import { getDetailApi } from '@api/publicAccount' import { getDetailApi } from '@api/publicAccount'
import { deepClone } from '@/common/util'
export default { export default {
name: 'AccountDetail', name: 'AccountDetail',
data() { data() {
...@@ -232,7 +223,7 @@ export default { ...@@ -232,7 +223,7 @@ export default {
getDetailApi({ merchantId: this.merchantId }).then(res => { getDetailApi({ merchantId: this.merchantId }).then(res => {
// console.log(res) // console.log(res)
this.currentPage = res.yseMerchantInfo ? res.yseMerchantInfo.custType : 'O' this.currentPage = res.yseMerchantInfo ? res.yseMerchantInfo.custType : 'O'
this.detailForm = _.cloneDeep({ this.detailForm = deepClone({
...res.bankInfo, ...res.bankInfo,
...res.serviceMerchant, ...res.serviceMerchant,
...res.yseMerchantInfo, ...res.yseMerchantInfo,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!