Commit 82455396 by 张立顺

替换deepclone 方法

1 parent 48860e00
Showing 57 changed files with 1047 additions and 1263 deletions
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
"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",
......
...@@ -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
......
...@@ -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下载文件
......
<!-- 编辑商品弹窗 --> <!-- 编辑商品弹窗 -->
<template> <template>
<d2-dialog <d2-dialog title="添加绑定升级商品"
title="添加绑定升级商品" :is-visible.sync="relateProVisible"
:is-visible.sync="relateProVisible" btn-ok-label="关联"
btn-ok-label="关联" width="950px"
width="950px" @confirmDialog="handleRelateProConfirm"
@confirmDialog="handleRelateProConfirm" @closeDialog="handleRelateProClose"
@closeDialog="handleRelateProClose" class="relatePro">
class="relatePro"
>
<div class="relateProDialog flex"> <div class="relateProDialog flex">
<img <img v-show="proInfo.thumbUrl"
v-show="proInfo.thumbUrl" :src="proInfo.thumbUrl">
:src="proInfo.thumbUrl" <img v-show="!proInfo.thumbUrl"
> src="./image/no-choice.png">
<img <el-form :model="proInfo"
v-show="!proInfo.thumbUrl" :rules="rules"
src="./image/no-choice.png" label-width="110px"
> ref="proRuleForm1"
<el-form style="width: calc(100% - 180px);">
:model="proInfo"
:rules="rules"
label-width="110px"
ref="proRuleForm1"
style="width: calc(100% - 180px);"
>
<div class="w-50"> <div class="w-50">
<el-form-item <el-form-item label="选择产品"
label="选择产品" prop="goodsCode">
prop="goodsCode" <el-select style="width: 98%;"
> v-model="proInfo.goodsCode"
<el-select placeholder="请选择一款作为升级商品"
style="width: 98%;" value-key="goodsCode"
v-model="proInfo.goodsCode" filterable
placeholder="请选择一款作为升级商品" @change="handleChangeGood">
value-key="goodsCode" <el-option v-for="item in proList"
filterable :key="item.goodsCode"
@change="handleChangeGood" :label="item.goodsName"
> :value="item.goodsCode"
<el-option :disabled="item.disabled" />
v-for="item in proList"
:key="item.goodsCode"
:label="item.goodsName"
:value="item.goodsCode"
:disabled="item.disabled"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</div> </div>
<div class="w-50"> <div class="w-50">
<el-form-item label="分类"> <el-form-item label="分类">
<el-input <el-input disabled
disabled placeholder="分类"
placeholder="分类" :value="proInfo.goodsTypeName"
:value="proInfo.goodsTypeName" class="dis-in-block" />
class="dis-in-block"
/>
</el-form-item> </el-form-item>
</div> </div>
<div class="w-50" /> <div class="w-50" />
<div class="w-50"> <div class="w-50">
<el-form-item label="编号"> <el-form-item label="编号">
<el-input <el-input disabled
disabled placeholder="编号"
placeholder="编号" :value="proInfo.sapCode"
:value="proInfo.sapCode" class="dis-in-block" />
class="dis-in-block"
/>
</el-form-item> </el-form-item>
</div> </div>
<div class="w-50"> <div class="w-50">
<el-form-item <el-form-item label="产品成本"
label="产品成本" prop="shopPrice">
prop="shopPrice" <el-input v-model="proInfo.shopPrice"
> placeholder="请输入建议产品成本"
<el-input class="dis-in-block"
v-model="proInfo.shopPrice" @input="handleShopPrice"
placeholder="请输入建议产品成本" @blur="handleShopPriceBlur">
class="dis-in-block" <i slot="suffix"
@input="handleShopPrice" class="suffix">元</i>
@blur="handleShopPriceBlur"
>
<i
slot="suffix"
class="suffix"
>元</i>
</el-input> </el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="w-50"> <div class="w-50">
<el-form-item <el-form-item label="建议升级价格"
label="建议升级价格" prop="upgradePrice">
prop="upgradePrice" <el-input v-model="proInfo.upgradePrice"
> placeholder="请输入建议升级价格"
<el-input class="dis-in-block"
v-model="proInfo.upgradePrice" @input="handleUpgradePrice">
placeholder="请输入建议升级价格" <i slot="suffix"
class="dis-in-block" class="suffix">元</i>
@input="handleUpgradePrice"
>
<i
slot="suffix"
class="suffix"
>元</i>
</el-input> </el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="w-50"> <div class="w-50">
<el-form-item <el-form-item label="商品最低价"
label="商品最低价" prop="shopMinPrice">
prop="shopMinPrice" <el-input v-model="proInfo.shopMinPrice"
> placeholder="请输入商品最低价"
<el-input class="dis-in-block"
v-model="proInfo.shopMinPrice" @input="handleShopMinPrice">
placeholder="请输入商品最低价" <i slot="suffix"
class="dis-in-block" class="suffix">元</i>
@input="handleShopMinPrice"
>
<i
slot="suffix"
class="suffix"
>元</i>
</el-input> </el-input>
</el-form-item> </el-form-item>
</div> </div>
<div <div class="w-50"
class="w-50" v-show="warrantyProList.includes(proInfo.goodsType)">
v-show="warrantyProList.includes(proInfo.goodsType)" <el-form-item label="质保年限"
> prop="warrantyPeriod">
<el-form-item <el-select style="width: 98%;"
label="质保年限" :class="{ 'select-suffix': !!proInfo.warrantyPeriod }"
prop="warrantyPeriod" v-model="proInfo.warrantyPeriod">
> <el-option v-for="item in warrantyPeriodList"
<el-select :key="item.confId"
style="width: 98%;" :label="item.confLabel"
:class="{ 'select-suffix': !!proInfo.warrantyPeriod }" :value="item.confId" />
v-model="proInfo.warrantyPeriod"
>
<el-option
v-for="item in warrantyPeriodList"
:key="item.confId"
:label="item.confLabel"
:value="item.confId"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</div> </div>
...@@ -152,14 +108,15 @@ ...@@ -152,14 +108,15 @@
</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'
export default { export default {
name: 'RelateProDialog', name: 'RelateProDialog',
data() { data() {
return { return {
goodVal: {}, goodVal: {},
warrantyProList: [1, 4, 6], warrantyProList,
proInfo: { proInfo: {
thumbUrl: '', thumbUrl: '',
goodsCode: '', goodsCode: '',
...@@ -244,7 +201,7 @@ export default { ...@@ -244,7 +201,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)
}, },
...@@ -326,7 +283,7 @@ export default { ...@@ -326,7 +283,7 @@ export default {
} }
.relatePro .select-suffix::after { .relatePro .select-suffix::after {
display: inline-block; display: inline-block;
content: '年'; content: "年";
position: absolute; position: absolute;
right: 30px; right: 30px;
top: 0px; top: 0px;
......
<!-- 表格+分页 --> <!-- 表格+分页 -->
<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()
}, },
......
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)
...@@ -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
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: {}
})
}
}
}
...@@ -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'
...@@ -405,7 +406,7 @@ export default { ...@@ -405,7 +406,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店支付',
......
...@@ -100,15 +100,16 @@ ...@@ -100,15 +100,16 @@
<script> <script>
// exportBaseList // exportBaseList
import { deepClone } from '@/common/util'
import { getList, baseGoodsUpOrDown, baseGoodsDelete, baseGoodsUpOrDownForChild } from '@api/commodity' import { getList, baseGoodsUpOrDown, baseGoodsDelete, baseGoodsUpOrDownForChild } from '@api/commodity'
import { getParkStore } from '@api/editCustomer' import { getParkStore } from '@api/editCustomer'
import { BaseData, brandMerchantList } from '@/common/constants.js' import { BaseData, brandMerchantList } from '@/common/constants.js'
// import { exportJsonToExcel } from '@/common/Export2Excel.js' // import { exportJsonToExcel } from '@/common/Export2Excel.js'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import _ from 'lodash' // import _ from 'lodash'
import storeDetail from './storeDetail' import storeDetail from './storeDetail'
import drawerDetail from './drawerDetail' import drawerDetail from './drawerDetail'
import { asyncExportExcel } from '@api/sys.base' // import { asyncExportExcel } from '@api/sys.base'
export default { export default {
name: 'Commodity', name: 'Commodity',
data() { data() {
...@@ -325,7 +326,7 @@ export default { ...@@ -325,7 +326,7 @@ export default {
mounted() { mounted() {
// const $store = this.$store.getters['d2admin/auth/curBtns'] // const $store = this.$store.getters['d2admin/auth/curBtns']
// console.log($store) // console.log($store)
this.baseData.brandList = _.cloneDeep(brandMerchantList) this.baseData.brandList = deepClone(brandMerchantList)
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)
...@@ -349,7 +350,7 @@ export default { ...@@ -349,7 +350,7 @@ export default {
}), }),
...mapActions('d2admin/user', ['actionSetDownloadList']), ...mapActions('d2admin/user', ['actionSetDownloadList']),
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: '', goodsType: '',
goodsTypeName: '全部' goodsTypeName: '全部'
...@@ -543,7 +544,7 @@ export default { ...@@ -543,7 +544,7 @@ export default {
} }
}, },
handleDetail(row) { handleDetail(row) {
this.detailData = _.cloneDeep(row) this.detailData = deepClone(row)
this.detailVisible = true this.detailVisible = true
}, },
handleDetailClose() { handleDetailClose() {
......
<!-- 领用详情 --> <!-- 领用详情 -->
<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()
}, },
......
...@@ -344,19 +344,21 @@ ...@@ -344,19 +344,21 @@
</template> </template>
<script> <script>
import _ from 'lodash' // import _ from 'lodash'
import { deepClone } from '@/common/util'
import relateProDialog from './relateProDialog' import relateProDialog from './relateProDialog'
import relateStoreDialog from './relateStoreDialog' import relateStoreDialog from './relateStoreDialog'
import { getGoodsList } from '@/api/commodity' import { getGoodsList } from '@/api/commodity'
// import { getParkStore } from '@api/editCustomer' // import { getParkStore } from '@api/editCustomer'
import { uploadImg } from '@/api/sys.base' import { uploadImg } from '@/api/sys.base'
import { limitPrice, userType, ghUserType } from '@/common/constants' import { limitPrice, userType, ghUserType, warrantyProList } from '@/common/constants'
export default { export default {
name: 'D2FormGoods', name: 'D2FormGoods',
data() { data() {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
warrantyProList: [1, 4, 6], warrantyProList: warrantyProList,
originProInfo: '',
merchantDisable: false, merchantDisable: false,
storeSearchForm: { storeSearchForm: {
yqMerchantName: '', yqMerchantName: '',
...@@ -446,7 +448,7 @@ export default { ...@@ -446,7 +448,7 @@ export default {
}, },
mounted() { mounted() {
this.formData = _.cloneDeep(this.originData) this.formData = deepClone(this.originData)
// if (this.userInfo.beSuper) { // if (this.userInfo.beSuper) {
// getParkStore({}).then(res => { // getParkStore({}).then(res => {
// this.parkServiceList = res // this.parkServiceList = res
...@@ -573,7 +575,7 @@ export default { ...@@ -573,7 +575,7 @@ export default {
handleClick(handleName) { handleClick(handleName) {
switch (handleName) { switch (handleName) {
case 'relateStore': case 'relateStore':
this.storeSelected = _.cloneDeep(this.formData.linkMerchants) this.storeSelected = deepClone(this.formData.linkMerchants)
// this.storeSearchForm = { // this.storeSearchForm = {
// yqMerchantId: this.formData.yqMerchantId // yqMerchantId: this.formData.yqMerchantId
// } // }
......
...@@ -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
}, }
} }
} }
......
...@@ -158,13 +158,13 @@ ...@@ -158,13 +158,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: {}
}, },
......
<!-- 产品编辑(素材管理) --> <!-- 产品编辑(素材管理) -->
<template> <template>
<d2-container class="edit-product"> <d2-container class="edit-product">
<d2-form <d2-form v-if="show"
v-if="show" ref="d2ProductForm"
ref="d2ProductForm" :form-item-width="formItemWidth"
:form-item-width="formItemWidth" :rules="rules"
:rules="rules" :add-or-edit="addOrEdit"
:add-or-edit="addOrEdit" form-name="product"
form-name="product" :origin-data="editData"
:origin-data="editData" :form-list="editForm"
:form-list="editForm" :form-ref="proFormRef"
:form-ref="proFormRef" @handleAddConfirm="handleAddConfirm"
@handleAddConfirm="handleAddConfirm" @handleClose="handleAddClose">
@handleClose="handleAddClose" <p slot="title"
> class="edit-title">
<p {{ addOrEdit === 'add' ? '新增素材' : '编辑素材' }}
slot="title"
class="edit-title"
>
{{ addOrEdit === 'add' ? '新增素材' : '编辑素材' }}
</p> </p>
</d2-form> </d2-form>
</d2-container> </d2-container>
</template> </template>
<script> <script>
import _ from 'lodash' // import _ from 'lodash'
import { deepClone } from '@/common/util'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { BaseData, brandMerchantList } from '@/common/constants.js' import { BaseData, brandMerchantList } from '@/common/constants.js'
import { addGoods, editGoods } from '@/api/product' import { addGoods, editGoods } from '@/api/product'
...@@ -139,7 +136,7 @@ export default { ...@@ -139,7 +136,7 @@ export default {
this.addOrEdit = this.$route.params.addOrEdit this.addOrEdit = this.$route.params.addOrEdit
if (this.addOrEdit === 'edit') { if (this.addOrEdit === 'edit') {
this.show = false this.show = false
this.editData = _.cloneDeep(this.$route.params.form) this.editData = deepClone(this.$route.params.form)
// !this.userInfo.beSuper && (this.editData.merchantId = this.userInfo.detail.merchantId) // !this.userInfo.beSuper && (this.editData.merchantId = this.userInfo.detail.merchantId)
this.editData.thumbUrlList = [{ this.editData.thumbUrlList = [{
content: '' content: ''
......
...@@ -58,11 +58,12 @@ ...@@ -58,11 +58,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 } from '@api/product'
import { BaseData, brandMerchantList } from '@/common/constants.js' import { BaseData, brandMerchantList } 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 {
...@@ -178,7 +179,7 @@ export default { ...@@ -178,7 +179,7 @@ export default {
}, },
mounted() { mounted() {
this.baseData.brandList = _.cloneDeep(brandMerchantList) this.baseData.brandList = deepClone(brandMerchantList)
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)
...@@ -192,7 +193,7 @@ export default { ...@@ -192,7 +193,7 @@ 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: '', goodsType: '',
goodsTypeName: '全部' goodsTypeName: '全部'
......
...@@ -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()
}) })
}, },
......
...@@ -218,6 +218,7 @@ import { payType } from '@/common/constants.js' ...@@ -218,6 +218,7 @@ import { payType } from '@/common/constants.js'
// import { getOrderDetail } from '@api/order' // import { getOrderDetail } from '@api/order'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { getList } from '@api/order' import { getList } from '@api/order'
import { deepClone } from '@/common/util'
export default { export default {
name: 'OrderDetail', name: 'OrderDetail',
components: { components: {
...@@ -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"
...@@ -252,12 +252,12 @@ ...@@ -252,12 +252,12 @@
</template> </template>
<script> <script>
import { Util } from '@/common/util' import { Util, deepClone } from '@/common/util'
import { getList, exportFile, getOrderCount, waitinputorderCount, orderImport } from '@api/order' import { getList, exportFile, getOrderCount, waitinputorderCount, orderImport } from '@api/order'
import { sourceChannelTypeList, manageTypeList, BaseData } from '@/common/constants' import { sourceChannelTypeList, 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() {
...@@ -468,8 +468,8 @@ export default { ...@@ -468,8 +468,8 @@ export default {
], ],
parkServiceList: [], parkServiceList: [],
storeIdList: [], storeIdList: [],
// sourceChannelTypeList: _.cloneDeep(sourceChannelTypeList), // sourceChannelTypeList: deepClone(sourceChannelTypeList),
manageTypeList: _.cloneDeep(manageTypeList), manageTypeList: 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 = 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,16 +70,17 @@ ...@@ -70,16 +70,17 @@
</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 _ from 'lodash'
// import { deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { getParkStore } from '@api/editCustomer' import { getParkStore } from '@api/editCustomer'
// waitinputorderExport // waitinputorderExport
...@@ -87,7 +88,7 @@ import { payTypeList } from '@/common/constants.js' ...@@ -87,7 +88,7 @@ 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 { 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 +306,7 @@ export default { ...@@ -305,7 +306,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 +412,7 @@ export default { ...@@ -411,7 +412,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 +420,9 @@ export default { ...@@ -419,9 +420,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 +447,9 @@ export default { ...@@ -446,9 +447,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)
......
<!-- 虚拟对公账户详情 --> <!-- 虚拟对公账户详情 -->
<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,
......
<!-- 虚拟对账账户 --> <!-- 虚拟对账账户 -->
<template> <template>
<d2-container class="account-list"> <d2-container class="account-list">
<div <div class="header"
class="header" slot="header">
slot="header" <d2-search ref="showSearch"
> :search-form="searchForm"
<d2-search :form-data="showFormData">
ref="showSearch" <template slot="channelType"
:search-form="searchForm" :slot-scope="item">
:form-data="showFormData" <el-cascader style="width: 50%;"
> :options="merchantLevelOptions[nameToOption[searchForm.channelType]]"
<template :props="{ checkStrictly: true, value: 'id', label: 'merchantName' }"
slot="channelType" :show-all-levels="false"
:slot-scope="item" v-model="merchantLevelVal"
> clearable
<el-cascader filterable />
style="width: 50%;"
:options="merchantLevelOptions[nameToOption[searchForm.channelType]]"
:props="{ checkStrictly: true, value: 'id', label: 'merchantName' }"
:show-all-levels="false"
v-model="merchantLevelVal"
clearable
filterable
/>
</template> </template>
</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 <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" <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-dialog <d2-dialog title="申请虚拟对公账户详情"
title="申请虚拟对公账户详情" :is-visible.sync="accountDetailVisible"
:is-visible.sync="accountDetailVisible" width="70%"
width="70%" btn-ok-label="确定"
btn-ok-label="确定" :no-cancel="true"
:no-cancel="true" @confirmDialog="handleDetailClose"
@confirmDialog="handleDetailClose" @closeDialog="handleDetailClose">
@closeDialog="handleDetailClose" <account-detail :account-detail-visible="accountDetailVisible"
> :merchant-row="merchantRow" />
<account-detail
:account-detail-visible="accountDetailVisible"
:merchant-row="merchantRow"
/>
</d2-dialog> </d2-dialog>
</d2-container> </d2-container>
</template> </template>
<script> <script>
import _ from 'lodash' // import _ from 'lodash'
import { Util } from '@/common/util' import { Util, deepClone } from '@/common/util'
import { getListApi, getMerchantLevelApi } from '@api/publicAccount' import { getListApi, getMerchantLevelApi } from '@api/publicAccount'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import accountDetail from './accountDetail' import accountDetail from './accountDetail'
...@@ -274,7 +254,7 @@ export default { ...@@ -274,7 +254,7 @@ export default {
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.searchFormSearch = _.cloneDeep(this.searchForm) this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.merchantTypeList = this.searchForm.merchantType ? [this.searchForm.merchantType] : [2, 7] this.searchFormSearch.merchantTypeList = this.searchForm.merchantType ? [this.searchForm.merchantType] : [2, 7]
this.searchFormSearch.merchantId = this.merchantLevelVal[this.merchantLevelVal.length - 1] this.searchFormSearch.merchantId = this.merchantLevelVal[this.merchantLevelVal.length - 1]
delete this.searchFormSearch.merchantType delete this.searchFormSearch.merchantType
......
<!-- 虚拟对公账户详情 --> <!-- 虚拟对公账户详情 -->
<template> <template>
<div <div class="account-detail"
class="account-detail" ref="accountDetail">
ref="accountDetail"
>
<!-- v-resize="resetTableHeight" <!-- v-resize="resetTableHeight"
:ref="'resize' + index" --> :ref="'resize' + index" -->
<div <div v-for="(formItem,index) in formArray"
v-for="(formItem,index) in formArray" v-resize="resetTableHeight"
v-resize="resetTableHeight" :ref="'resize' + index"
:ref="'resize' + index" :key="index">
:key="index" <p class="edit-sub-title "
> :class="{'sub-border':!formItem.show}">
<p
class="edit-sub-title "
:class="{'sub-border':!formItem.show}"
>
<span class="label">{{ formItem.label }}</span> <span class="label">{{ formItem.label }}</span>
<span <span class="collapse"
class="collapse" @click="formItem.show = !formItem.show">
@click="formItem.show = !formItem.show" <i :class="{'move':!formItem.show}"
> class="arrow el-icon-arrow-down" />
<i
:class="{'move':!formItem.show}"
class="arrow el-icon-arrow-down"
/>
{{ formItem.show?'收起':'展开' }} </span> {{ formItem.show?'收起':'展开' }} </span>
</p> </p>
<el-collapse-transition> <el-collapse-transition>
<div <div v-show="formItem.show"
v-show="formItem.show" class="itemContainer">
class="itemContainer" <el-form :model="merchantRow"
> label-width="170px">
<el-form
:model="merchantRow"
label-width="170px"
>
<!-- <p class="edit-sub-title ">账户信息</p> <!-- <p class="edit-sub-title ">账户信息</p>
<el-form-item label="客户名称:" <el-form-item 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> --> <p class="edit-sub-title">申请资料</p> -->
<div <div v-for="(item, index) in formItem.formList"
v-for="(item, index) in formItem.formList" :key="index">
:key="index"
>
<!-- <el-form-item v-if="(item.showAttrList ? item.showAttrList.includes(detailForm.custType) : true)&&(item.showPayType?item.showPayType.includes(detailForm.settlementType):true)" <!-- <el-form-item v-if="(item.showAttrList ? item.showAttrList.includes(detailForm.custType) : true)&&(item.showPayType?item.showPayType.includes(detailForm.settlementType):true)"
:label="typeof item.label === 'object' ? (item.label[currentPage] + ':') : (item.label + ':')" :label="typeof item.label === 'object' ? (item.label[currentPage] + ':') : (item.label + ':')"
required required
...@@ -58,39 +42,27 @@ ...@@ -58,39 +42,27 @@
:src="detailForm.papersList?detailForm.papersList[imgToAttr[subItem]]:''"> :src="detailForm.papersList?detailForm.papersList[imgToAttr[subItem]]:''">
</span> --> </span> -->
<!-- .toString() --> <!-- .toString() -->
<el-form-item <el-form-item v-if="(item.showAttrList ? item.showAttrList.includes(detailForm.custType ) : true)&&(item.showPayType?item.showPayType.includes(detailForm.settlementType):true)&&(item.contractType?item.contractType.includes(detailForm.contractType || 1 ):true)"
v-if="(item.showAttrList ? item.showAttrList.includes(detailForm.custType ) : true)&&(item.showPayType?item.showPayType.includes(detailForm.settlementType):true)&&(item.contractType?item.contractType.includes(detailForm.contractType || 1 ):true)" :label="typeof item.label === 'object' ? (item.label[currentPage] + ':') : (item.label + ':')"
:label="typeof item.label === 'object' ? (item.label[currentPage] + ':') : (item.label + ':')" required
required :prop="item.prop">
:prop="item.prop"
>
<span v-if="item.type === 'image'"> <span v-if="item.type === 'image'">
<!-- <div></div> style="display:inline-block" --> <!-- <div></div> style="display:inline-block" -->
<span <span v-for="(subItem, subIdx) in item.imgList"
v-for="(subItem, subIdx) in item.imgList" class="imageContainer"
class="imageContainer" :key="subIdx">
:key="subIdx"
>
<!-- v-for="(subItem, subIdx) in item.imgList" --> <!-- v-for="(subItem, subIdx) in item.imgList" -->
<img <img class="detail-img"
class="detail-img" :src="detailForm.papersList?detailForm.papersList[imgToAttr[subItem]]:''">
:src="detailForm.papersList?detailForm.papersList[imgToAttr[subItem]]:''" <span class="img-btns"
> @click.stop="handleImgLook(detailForm.papersList?detailForm.papersList[imgToAttr[subItem]]:'')">
<span
class="img-btns"
@click.stop="handleImgLook(detailForm.papersList?detailForm.papersList[imgToAttr[subItem]]:'')"
>
<span class="btn-item"> <span class="btn-item">
<i <i class="el-icon-zoom-in"
class="el-icon-zoom-in" style="font-size:30px" />
style="font-size:30px"
/>
</span> </span>
</span> </span>
<div <div v-if="item.labelList"
v-if="item.labelList" class="imageLabel">
class="imageLabel"
>
{{ item.labelList[subIdx] }} {{ item.labelList[subIdx] }}
</div> </div>
</span> </span>
...@@ -101,11 +73,9 @@ ...@@ -101,11 +73,9 @@
:key="subIdx">{{detailForm.papersList?detailForm.papersList[imgToAttr[subItem]]:''}}</span> --> :key="subIdx">{{detailForm.papersList?detailForm.papersList[imgToAttr[subItem]]:''}}</span> -->
</span> </span>
<span v-else-if="item.formatter">{{ item.formatter(item) }}</span> <span v-else-if="item.formatter">{{ item.formatter(item) }}</span>
<span <span v-else-if="item.type== 'url'"
v-else-if="item.type== 'url'" class="link"
class="link" @click="downloads">点击链接下载</span>
@click="downloads"
>点击链接下载</span>
<span v-else>{{ detailForm[item.prop]||'' }}</span> <span v-else>{{ detailForm[item.prop]||'' }}</span>
</el-form-item> </el-form-item>
</div> </div>
...@@ -138,15 +108,11 @@ ...@@ -138,15 +108,11 @@
</el-form-item> </el-form-item>
</div> </div>
</el-form> --> </el-form> -->
<el-dialog <el-dialog :visible.sync="lookImgVisible"
:visible.sync="lookImgVisible" append-to-body>
append-to-body <img width="100%"
> :src="picUrl"
<img alt="图片">
width="100%"
:src="picUrl"
alt="图片"
>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -154,6 +120,7 @@ ...@@ -154,6 +120,7 @@
<script> <script>
import { getDetailApi, downloadContract } from '@api/publicAccount' import { getDetailApi, downloadContract } from '@api/publicAccount'
import resize from '@/common/resize' import resize from '@/common/resize'
import { deepClone } from '@/common/util'
// import Collapse from '@/common/expansion.js' // import Collapse from '@/common/expansion.js'
export default { export default {
name: 'AccountDetail', name: 'AccountDetail',
...@@ -789,7 +756,7 @@ export default { ...@@ -789,7 +756,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,
......
...@@ -60,8 +60,8 @@ ...@@ -60,8 +60,8 @@
</template> </template>
<script> <script>
import _ from 'lodash' // import _ from 'lodash'
import { Util } from '@/common/util' import { Util, deepClone } from '@/common/util'
import { getListApi, getMerchantLevelApi } from '@api/publicAccount' import { getListApi, getMerchantLevelApi } from '@api/publicAccount'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import accountDetail from './accountDetail' import accountDetail from './accountDetail'
...@@ -232,7 +232,7 @@ export default { ...@@ -232,7 +232,7 @@ export default {
} }
}, },
components: { components: {
accountDetail, accountDetail
// baseDialog, // baseDialog,
// settingDetail // settingDetail
}, },
...@@ -311,7 +311,7 @@ export default { ...@@ -311,7 +311,7 @@ export default {
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.searchFormSearch = _.cloneDeep(this.searchForm) this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.merchantTypeList = this.searchForm.merchantType ? [this.searchForm.merchantType] : [2, 7, -1] this.searchFormSearch.merchantTypeList = this.searchForm.merchantType ? [this.searchForm.merchantType] : [2, 7, -1]
this.searchFormSearch.merchantId = this.searchForm.merchantId ? this.searchForm.merchantId : this.merchantLevelVal[this.merchantLevelVal.length - 1] this.searchFormSearch.merchantId = this.searchForm.merchantId ? this.searchForm.merchantId : this.merchantLevelVal[this.merchantLevelVal.length - 1]
......
...@@ -65,8 +65,8 @@ ...@@ -65,8 +65,8 @@
<!-- !relateMerchantObj.partnerMerchantName --> <!-- !relateMerchantObj.partnerMerchantName -->
<p class="relate-service"> <p class="relate-service">
<span v-if=" <span v-if="
storeSearchForm.yqMerchantId && !relateMerchantObjShow storeSearchForm.yqMerchantId && !relateMerchantObjShow
">该园区店暂未关联服务商<a href="#/serviceManage" ">该园区店暂未关联服务商<a href="#/serviceManage"
target="_blank" target="_blank"
rel="opener" rel="opener"
style="margin-left: 20px">关联服务商></a></span> style="margin-left: 20px">关联服务商></a></span>
...@@ -85,8 +85,8 @@ ...@@ -85,8 +85,8 @@
<el-form-item label="选择渠道:"> <el-form-item label="选择渠道:">
<el-select v-model="storeSearchForm.channelType"> <el-select v-model="storeSearchForm.channelType">
<el-option v-for="item in baseData.channelTypeList.filter( <el-option v-for="item in baseData.channelTypeList.filter(
(item) => item.value !== '' (item) => item.value !== ''
)" )"
:key="item.value" :key="item.value"
:label="item.name" :label="item.name"
:value="item.value" /> :value="item.value" />
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
@confirmDialog="brandOkButton" @confirmDialog="brandOkButton"
@closeDialog="brandSettingsButton"> @closeDialog="brandSettingsButton">
<span slot="sub-title" <span slot="sub-title"
class="second_title">{{`${rowData.merchantName}${rowData.merchantId}`}}</span> class="second_title">{{ `${rowData.merchantName}${rowData.merchantId}` }}</span>
<div class="brandBox"> <div class="brandBox">
<div class="leftBox"> <div class="leftBox">
<div class="brand-top"> <div class="brand-top">
...@@ -205,11 +205,11 @@ ...@@ -205,11 +205,11 @@
</template> </template>
<script> <script>
import { Util } from "@/common/util" import { Util, deepClone } from "@/common/util"
import _ from "lodash" // import _ from "lodash"
import viewDetail from "./viewDetail" import viewDetail from "./viewDetail"
import financialRulesDetail from "./financialRulesDetail" import financialRulesDetail from "./financialRulesDetail"
import baseDialog from "@/components/baseDialog" // import baseDialog from "@/components/baseDialog"
import { import {
getList, getList,
deleteMerchant, deleteMerchant,
...@@ -520,10 +520,10 @@ export default { ...@@ -520,10 +520,10 @@ export default {
this.parkServiceList = res this.parkServiceList = res
}) })
this.getBaseData() this.getBaseData()
this.userTypeList = _.cloneDeep(userTypeList).filter( this.userTypeList = deepClone(userTypeList).filter(
(item) => item.confLabel !== "员工" (item) => item.confLabel !== "员工"
) )
this.ghUserTypeList = _.cloneDeep(ghUserTypeList).filter( this.ghUserTypeList = deepClone(ghUserTypeList).filter(
(item) => !["员工", "供应商"].includes(item.confLabel) (item) => !["员工", "供应商"].includes(item.confLabel)
) )
}, },
...@@ -722,7 +722,7 @@ export default { ...@@ -722,7 +722,7 @@ export default {
this.$refs.merchantTable.refreshTable() this.$refs.merchantTable.refreshTable()
}, },
handleViewDetail(row) { handleViewDetail(row) {
this.viewDetailData = _.cloneDeep(row) this.viewDetailData = deepClone(row)
this.handleViewClose() this.handleViewClose()
}, },
// 品牌设置确认 // 品牌设置确认
......
...@@ -6,146 +6,110 @@ ...@@ -6,146 +6,110 @@
<p class="flex"> <p class="flex">
<span>门店名称:{{ form.merchantName }}</span> <span>门店名称:{{ form.merchantName }}</span>
<span>业务类型: <span>业务类型:
<el-select <el-select :size="size"
:size="size" v-model="form.bizType">
v-model="form.bizType" <el-option v-for="(item, index) in bizTypeList"
> :key="index"
<el-option :value="item.confId"
v-for="(item, index) in bizTypeList" :label="item.confLabel"
:key="index" :disabled="item.confId === '2'" />
:value="item.confId"
:label="item.confLabel"
:disabled="item.confId === '2'"
/>
</el-select> </el-select>
</span> </span>
</p> </p>
</div> </div>
<div class="flex step-bar"> <div class="flex step-bar">
<p <p @click="handleStep(1)"
@click="handleStep(1)" :class="{'active': stepStat === 1}">
:class="{'active': stepStat === 1}"
>
财务设置 财务设置
</p> </p>
<p <p @click="handleStep(2)"
@click="handleStep(2)" :class="{'active': stepStat === 2}">
:class="{'active': stepStat === 2}"
>
分账金额设置 分账金额设置
</p> </p>
<p <p @click="handleStep(3)"
@click="handleStep(3)" :class="{'active': stepStat === 3}">
:class="{'active': stepStat === 3}"
>
分账测试 分账测试
</p> </p>
<p <p @click="handleStep(4)"
@click="handleStep(4)" :class="{'active': stepStat === 4}">
:class="{'active': stepStat === 4}"
>
开启分账 开启分账
</p> </p>
</div> </div>
<div> <div>
<step-one <step-one ref="step1"
ref="step1" v-show="stepStat === 1"
v-show="stepStat === 1" :form="form"
:form="form" @handleNextStep="handleNextStep" />
@handleNextStep="handleNextStep" <step-two ref="step2"
/> v-if="stepStat === 2"
<step-two :sms-form="form"
ref="step2" :merchant-info="ruleForm"
v-if="stepStat === 2" @handleNextStep="handleNextStep" />
:sms-form="form" <step-three ref="step3"
:merchant-info="ruleForm" v-show="stepStat === 3"
@handleNextStep="handleNextStep" :step-stat="stepStat"
/> :sms-form="form"
<step-three :merchant-info="ruleForm"
ref="step3" @getRuleProgress="getInfo"
v-show="stepStat === 3" @changeParentVal="changeParentVal"
:step-stat="stepStat" @handleSave="handleConfirm"
:sms-form="form" @handleNextStep="handleNextStep" />
:merchant-info="ruleForm" <step-four ref="step4"
@getRuleProgress="getInfo" v-show="stepStat === 4"
@changeParentVal="changeParentVal" :step-stat="stepStat"
@handleSave="handleConfirm" :sms-form="form"
@handleNextStep="handleNextStep" :merchant-info="ruleForm"
/> @handleNextStep="handleNextStep" />
<step-four
ref="step4"
v-show="stepStat === 4"
:step-stat="stepStat"
:sms-form="form"
:merchant-info="ruleForm"
@handleNextStep="handleNextStep"
/>
</div> </div>
</div> </div>
<!-- 短信模块 --> <!-- 短信模块 -->
<div <div class="d2-container-content"
class="d2-container-content" v-show="[1,2,4].includes(stepStat)">
v-show="[1,2,4].includes(stepStat)"
>
<p class="edit-sub-title"> <p class="edit-sub-title">
安全验证<span class="title-tips">提交信息后第二天生效!</span> 安全验证<span class="title-tips">提交信息后第二天生效!</span>
</p> </p>
<el-form <el-form ref="form"
ref="form" :model="form"
:model="form" :rules="rules"
:rules="rules" label-suffix=":"
label-suffix=":" label-width="180px">
label-width="180px"
>
<el-form-item label="管理员手机号验证"> <el-form-item label="管理员手机号验证">
{{ adminInfo.name }} {{ adminInfo.phone }} {{ adminInfo.name }} {{ adminInfo.phone }}
<el-button <el-button :size="size"
:size="size" @click="handleSend"
@click="handleSend" :disabled="isSend">
:disabled="isSend"
>
{{ isSend ? sendMsg + '秒后,重试' : '发送验证短信' }} {{ isSend ? sendMsg + '秒后,重试' : '发送验证短信' }}
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="验证码"
label="验证码" prop="smsCode">
prop="smsCode" <el-input placeholder="请填写验证码"
> v-model="form.smsCode"
<el-input :size="size"
placeholder="请填写验证码" style="width: 220px;" />
v-model="form.smsCode"
:size="size"
style="width: 220px;"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<!-- 按钮模块 --> <!-- 按钮模块 -->
<div class="d2-container-content box-btn"> <div class="d2-container-content box-btn">
<el-button <el-button v-show="[2,3,4].includes(stepStat)"
v-show="[2,3,4].includes(stepStat)" :size="size"
:size="size" @click="handleLastStep">
@click="handleLastStep"
>
上一步 上一步
</el-button> </el-button>
<el-button <el-button type="primary"
type="primary" v-show="isShowOkbtn"
v-show="isShowOkbtn" :size="size"
:size="size" @click="handleConfirm">
@click="handleConfirm"
>
确认 确认
</el-button> </el-button>
<!-- :disabled="isFirstSetEdit || isSecondSetEdit" --> <!-- :disabled="isFirstSetEdit || isSecondSetEdit" -->
<el-button <el-button :size="size"
:size="size" @click="handleCancel">
@click="handleCancel"
>
取消 取消
</el-button> </el-button>
</div> </div>
...@@ -153,7 +117,8 @@ ...@@ -153,7 +117,8 @@
</template> </template>
<script> <script>
import _ from 'lodash' // import _ from 'lodash'
import { deepClone } from '@/common/util'
import stepOne from './stepOne' import stepOne from './stepOne'
import stepTwo from './stepTwo' import stepTwo from './stepTwo'
import stepThree from './stepThree' import stepThree from './stepThree'
...@@ -249,7 +214,7 @@ export default { ...@@ -249,7 +214,7 @@ export default {
}), }),
async getBaseData() { async getBaseData() {
this.baseData.productTypeList = _.cloneDeep(await this.get(BaseData.productType)) this.baseData.productTypeList = deepClone(await this.get(BaseData.productType))
}, },
getInfo() { getInfo() {
......
...@@ -461,7 +461,7 @@ ...@@ -461,7 +461,7 @@
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { BaseData, userType, ghUserType, limitPrice } from '@/common/constants.js' import { BaseData, userType, ghUserType, limitPrice } from '@/common/constants.js'
import { getAccountRule, updateRule } from '@api/merchant' import { getAccountRule, updateRule } from '@api/merchant'
import { returnFloat } from '@/common/util' import { returnFloat, deepClone } from '@/common/util'
export default { export default {
name: 'StepOne', name: 'StepOne',
props: { props: {
...@@ -672,7 +672,7 @@ export default { ...@@ -672,7 +672,7 @@ export default {
} }
}, },
async getBaseData() { async getBaseData() {
this.baseData.productTypeList = _.cloneDeep(await this.get(BaseData.productType)) this.baseData.productTypeList = deepClone(await this.get(BaseData.productType))
// console.log(this.baseData.productTypeList) // console.log(this.baseData.productTypeList)
}, },
...@@ -747,7 +747,7 @@ export default { ...@@ -747,7 +747,7 @@ export default {
this.$refs[refsAttr].validateField(validArr, valid => { this.$refs[refsAttr].validateField(validArr, valid => {
valid && (isEmpty = true) valid && (isEmpty = true)
}) })
!isEmpty && this[formAttr].list.push(_.cloneDeep(this[addStructAttr])) !isEmpty && this[formAttr].list.push(deepClone(this[addStructAttr]))
}, },
handleAccountDelete(formAttr, item, index) { handleAccountDelete(formAttr, item, index) {
this.$confirm('是否删除该品类', '提示', { this.$confirm('是否删除该品类', '提示', {
...@@ -781,7 +781,7 @@ export default { ...@@ -781,7 +781,7 @@ export default {
this[formAttr].list.forEach((i, idx) => { this[formAttr].list.forEach((i, idx) => {
cascadeLen = this[cascadeChangeAttr].list.length cascadeLen = this[cascadeChangeAttr].list.length
if (cascadeLen < idx + 1) { if (cascadeLen < idx + 1) {
this[cascadeChangeAttr].list.push(_.cloneDeep(this[addStructAttr])) this[cascadeChangeAttr].list.push(deepClone(this[addStructAttr]))
var cascadeEditAttr = isEditAttr === 'isFirstSetEdit' ? 'isSecondSetEdit' : 'isFirstSetEdit' var cascadeEditAttr = isEditAttr === 'isFirstSetEdit' ? 'isSecondSetEdit' : 'isFirstSetEdit'
this[cascadeEditAttr] = !this[cascadeEditAttr] this[cascadeEditAttr] = !this[cascadeEditAttr]
} }
...@@ -845,7 +845,7 @@ export default { ...@@ -845,7 +845,7 @@ export default {
if (this.accountSecondSetForm.partnerSettleAccountModel == 1) { if (this.accountSecondSetForm.partnerSettleAccountModel == 1) {
params.singlePartnerMerchantId = this.accountSecondSetForm.singlePartnerMerchantId params.singlePartnerMerchantId = this.accountSecondSetForm.singlePartnerMerchantId
} else { } else {
const obj = _.cloneDeep(this.accountSecondSetForm) const obj = deepClone(this.accountSecondSetForm)
delete obj.list delete obj.list
delete obj.singlePartnerMerchantId delete obj.singlePartnerMerchantId
if (this.accountSecondSetForm.installCostCalculateType == 1) delete obj.installCostSettleType if (this.accountSecondSetForm.installCostCalculateType == 1) delete obj.installCostSettleType
......
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
</template> </template>
<script> <script>
import { Util, returnFloat } from '@/common/util' import { Util, returnFloat, deepClone } from '@/common/util'
// import { deepClone } from '@/libs/util' // import { deepClone } from '@/libs/util'
// import { Util, deepClone, returnFloat } from '@/common/util' // import { Util, deepClone, returnFloat } from '@/common/util'
import { getAccountRule, getDivisionRuleApi, entrydateUpdate } from '@api/merchant' import { getAccountRule, getDivisionRuleApi, entrydateUpdate } from '@api/merchant'
...@@ -424,7 +424,7 @@ export default { ...@@ -424,7 +424,7 @@ export default {
} else { } else {
this.setAccountRule(this.merchantInfo.settleRule) this.setAccountRule(this.merchantInfo.settleRule)
console.log(this.merchantInfo.divisionRule) console.log(this.merchantInfo.divisionRule)
this.setDivisionRule(Util.deepClone(this.merchantInfo.divisionRule)) this.setDivisionRule(deepClone(this.merchantInfo.divisionRule))
// const res = Object.assign(this.merchantInfo.settleRule, this.merchantInfo.divisionRule) // const res = Object.assign(this.merchantInfo.settleRule, this.merchantInfo.divisionRule)
// this.setDivisionRule(res) // this.setDivisionRule(res)
} }
...@@ -490,7 +490,10 @@ export default { ...@@ -490,7 +490,10 @@ export default {
if (val.merchantProfitValue) val.merchantProfitValue = returnFloat(val.merchantProfitValue) if (val.merchantProfitValue) val.merchantProfitValue = returnFloat(val.merchantProfitValue)
if (val.partnerProfitPer) val.partnerProfitPer = returnFloat(val.partnerProfitPer) if (val.partnerProfitPer) val.partnerProfitPer = returnFloat(val.partnerProfitPer)
}) })
this.settleRuleList = Util.deepClone(res.goodsTypeSettleRuleList) this.settleRuleList = deepClone(res.goodsTypeSettleRuleList)
// console.log(this.settleRuleList)
// console.log(deepClone(res.goodsTypeSettleRuleList))
// debugger
// console.log(res.goodsTypeSettleRuleList) // console.log(res.goodsTypeSettleRuleList)
this.merchantInfo.deductChargeFlag = res.deductChargeFlag this.merchantInfo.deductChargeFlag = res.deductChargeFlag
this.settleRuleList.unshift({ this.settleRuleList.unshift({
......
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
</template> </template>
<script> <script>
import { Util } from '@/common/util' import { Util, deepClone } from '@/common/util'
// addParentMerchant, // addParentMerchant,
import { getList, getMerchantList, deleteParentMerchant, saveParentMerchant } from '@api/serviceManage' import { getList, getMerchantList, deleteParentMerchant, saveParentMerchant } from '@api/serviceManage'
import { getParkStore } from '@api/editCustomer' import { getParkStore } from '@api/editCustomer'
...@@ -350,7 +350,7 @@ export default { ...@@ -350,7 +350,7 @@ export default {
// 删除服务商 // 删除服务商
handleDelete(row) { handleDelete(row) {
this.recordId = row.id this.recordId = row.id
var record = _.cloneDeep(row) var record = deepClone(row)
this.handleDeleteClose(record) this.handleDeleteClose(record)
}, },
handleDeleteClose(record) { handleDeleteClose(record) {
......
<!-- 服务商管理 --> <!-- 服务商管理 -->
<template> <template>
<d2-container class="service-manage"> <d2-container class="service-manage">
<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>
...@@ -32,41 +24,35 @@ ...@@ -32,41 +24,35 @@
<span slot="left">园区店服务商关联列表</span> <span slot="left">园区店服务商关联列表</span>
<auth-button category="Button" /> <auth-button category="Button" />
</d2-table-header> </d2-table-header>
<d2-table <d2-table ref="serviceStoreTable"
ref="serviceStoreTable" :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" <auth-button slot="auth-button"
> slot-scope="scope"
<auth-button :data="scope.scope">
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
>
<!-- <el-button type="text" <!-- <el-button type="text"
size="mini" size="mini"
style="margin-right: 10px;" style="margin-right: 10px;"
@click="collectionQRcode(scope.row)">收款二维码</el-button> --> @click="collectionQRcode(scope.row)">收款二维码</el-button> -->
</auth-button> </auth-button>
</d2-table> </d2-table>
<qrcode-dialog <qrcode-dialog :q-rcode-visible="qRcodeVisible"
:q-rcode-visible="qRcodeVisible" :info="recordInfo"
:info="recordInfo" v-if="qRcodeVisible"
v-if="qRcodeVisible" @dialogClose="dialogClose" />
@dialogClose="dialogClose"
/>
</div> </div>
<wxQRcodeDialog :qRcodeVisible.sync="QRcodeDialog" <wxQRcodeDialog :q-rcode-visible.sync="QRcodeDialog"
v-if="QRcodeDialog" v-if="QRcodeDialog"
:merchantInfo="recordInfo"></wxQRcodeDialog> :merchant-info="recordInfo" />
</d2-container> </d2-container>
</template> </template>
<script> <script>
import { Util } from '@/common/util' import { Util, deepClone } from '@/common/util'
import _ from 'lodash' // import _ from 'lodash'
import { import {
// getList, // getList,
// getMerchantList, // getMerchantList,
...@@ -228,7 +214,7 @@ export default { ...@@ -228,7 +214,7 @@ export default {
8: '虚拟园区店', 8: '虚拟园区店',
9: '供应商' 9: '供应商'
}, },
manageTypeList: _.cloneDeep(manageTypeList) manageTypeList: deepClone(manageTypeList)
}, },
qRcodeVisible: false, qRcodeVisible: false,
QRcodeDialog: false, QRcodeDialog: false,
...@@ -265,7 +251,7 @@ export default { ...@@ -265,7 +251,7 @@ export default {
}, },
// 加微二维码 // 加微二维码
handleQrcode(row) { handleQrcode(row) {
this.recordInfo = _.cloneDeep(row) this.recordInfo = deepClone(row)
this.QRcodeDialog = true this.QRcodeDialog = true
}, },
// 重置 // 重置
......
...@@ -9290,6 +9290,11 @@ reusify@^1.0.4: ...@@ -9290,6 +9290,11 @@ reusify@^1.0.4:
resolved "https://registry.npmmirror.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" resolved "https://registry.npmmirror.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==
rfdc@^1.3.0:
version "1.3.0"
resolved "https://registry.npmmirror.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b"
integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==
rgbcolor@^1.0.1: rgbcolor@^1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.npmjs.org/rgbcolor/-/rgbcolor-1.0.1.tgz" resolved "https://registry.npmjs.org/rgbcolor/-/rgbcolor-1.0.1.tgz"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!