Commit 7f68e51f by 张立顺

v4.11.0 bug修复

1 parent 19ff6bb0
......@@ -4,9 +4,9 @@
* @Last Modified by: chenwq
* @Last Modified time: 2021-06-18 10:04:32
*/
import sha1 from 'sha1'
import qs from 'qs'
import { baseConfig } from '@/main'
import sha1 from "sha1"
import qs from "qs"
import { baseConfig } from "@/main"
// // const secret =
// // window.location.href.includes('dj.glsx.com.cn') ||
......@@ -21,32 +21,33 @@ const sign = (params, noSignAttr = []) => {
// console.log(secret)
delete params.sign
var objStr = qs.stringify(_.cloneDeep(params), {
arrayFormat: 'indices',
arrayFormat: "indices",
allowDots: true,
encodeValuesOnly: true
})
var objVal = objStr.split('&')
var objVal = objStr.split("&")
var realObj = {}
objVal.forEach(item => {
const idx = item.indexOf('=')
realObj[item.split('=')[0]] = decodeURIComponent(item.slice(idx + 1))
objVal.forEach((item) => {
const idx = item.indexOf("=")
realObj[item.split("=")[0]] = decodeURIComponent(item.slice(idx + 1))
})
// console.log(realObj)
const keys = Object.keys(realObj).sort()
var str = []
var obj = null
for (const key in realObj) {
obj = realObj[key]
if (obj === null) {
obj = ''
} else if (typeof obj === 'object') {
obj = ""
} else if (typeof obj === "object") {
obj = JSON.stringify(obj)
}
realObj[key] = obj
}
keys.forEach(e => {
keys.forEach((e) => {
!noSignAttr.includes(e) && str.push(e + realObj[e])
})
realObj.sign = sha1(secret + str.join('') + secret).toUpperCase()
realObj.sign = sha1(secret + str.join("") + secret).toUpperCase()
return realObj
}
export default sign
......@@ -224,29 +224,29 @@ export const Util = {
// * console.log(bar===foo) false
// * @param {*} obj
// */
// deepClone: function (obj) {
// // Handle the 3 simple types, and null or undefined or function
// if (obj == null || typeof obj !== "object") return obj
// // Handle Date
// if (obj instanceof Date) {
// const copy = new Date()
// copy.setTime(obj.getTime())
// return copy
// }
// // Handle Array or Object
// if ((obj instanceof Array) | (obj instanceof Object)) {
// const copy = obj instanceof Array ? [] : {}
// for (var attr in obj) {
// // if (Object.prototype.hasOwnProperty.call(attr)) {
// if (obj.hasOwnProperty(attr)) {
// copy[attr] = Util.deepClone(obj[attr])
// console.log("copy[attr] ", copy[attr])
// }
// }
// return copy
// }
// throw new Error("Unable to clone obj! Its type isn't supported.")
// },
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下载文件
......@@ -320,19 +320,19 @@ export const Util = {
return field || show
},
// 整数补零显示两位小数
returnFloat: function(num) {
num = num.toString();
returnFloat: function (num) {
num = num.toString()
if (num.indexOf(".") != -1) {
let newVal = num.split(".");
let newVal = num.split(".")
if (newVal[1].length == 1) {
newVal = newVal.join(".");
newVal += "0";
num = newVal;
newVal = newVal.join(".")
newVal += "0"
num = newVal
}
} else {
num += ".00";
num += ".00"
}
return num;
return num
}
}
......@@ -340,6 +340,6 @@ export const showModal = Util.msg
export const showToast = Util.Info
export const showLoading = Util.loading
export const hideLoading = Util.closeLoading
// export const deepClone = Util.deepClone
export const deepClone = Util.deepClone
export const downLoadFile = Util.downLoadFile
export const returnFloat = Util.returnFloat
......@@ -78,9 +78,12 @@ util.deepCloneObj = (target) => {
if ([Date, RegExp].includes(data.constructor)) {
return new data.constructor(data)
}
// 会在生产环境的clone props对象报错 导致报错 弃用
if (typeof data === "function") {
return new Function("return " + data.toString())()
}
const exist = map.get(data)
if (exist) {
return exist
......
......@@ -107,7 +107,7 @@ export default {
// util.permision.flatten(Object.values(localRoutes))
// .map(obj => ({ authId: obj.authId, parentId: obj.parentId })) :
// tempAuths
console.log(tempAuths)
// console.log(tempAuths)
const authes = tempAuths
await dispatch("d2admin/auth/set", authes, { root: true })
// delete accountInfo.authes
......
......@@ -69,7 +69,9 @@ import { getParkStore } from '@api/editCustomer'
// waitinputorderExport
import { payTypeList } from '@/common/constants.js'
import { waitinputorderCount, waitinputorderPage, getList } from '@api/order'
import { asyncExportExcel } from '@api/sys.base'
// import { asyncExportExcel } from '@api/sys.base'
const clonePayTypeList = _.cloneDeep(payTypeList)
clonePayTypeList.splice(1, 1)
export default {
name: 'OrderSupplement',
data() {
......@@ -241,7 +243,7 @@ export default {
confLabel: '未补录'
}
],
payTypeList: _.cloneDeep(payTypeList)
payTypeList: clonePayTypeList
}
}
},
......
<!-- 历史财务规则 -->
<template>
<div
class="account-detail"
ref="accountDetail"
>
<div class="account-detail"
ref="accountDetail">
<!-- v-resize="resetTableHeight"
:ref="'resize' + index" -->
<div v-if="formArray&&formArray.length">
<div
v-for="(formItem,index) in formArray"
v-resize="resetTableHeight"
:ref="'resize' + index"
:key="index"
>
<p
class="edit-sub-title "
:class="{'sub-border':!formItem.show}"
>
<div v-for="(formItem,index) in formArray"
v-resize="resetTableHeight"
:ref="'resize' + index"
:key="index">
<p class="edit-sub-title "
:class="{'sub-border':!formItem.show}">
<span class="label">
<span>{{ formItem.formatEffectStartDate }}</span>
<span v-if="formItem.formatEffectStartDate"> - </span>
<span
:class="{'labelColor':!formItem.formatEffectEndDate}"
>{{ formItem.formatEffectStartDate?formItem.formatEffectEndDate?formItem.formatEffectEndDate:'生效中':'待生效' }}</span>
:class="{'labelColor':!formItem.formatEffectEndDate}">{{ formItem.formatEffectStartDate?formItem.formatEffectEndDate?formItem.formatEffectEndDate:'生效中':'待生效' }}</span>
</span>
<span class="updatedInfo">
操作人: {{ formItem.updatedBy }} 操作时间: {{ formItem.formatUpdatedDate }}
</span>
<span
class="collapse"
@click="collapseItem(index)"
>
<i
:class="{'move':!formItem.show}"
class="arrow el-icon-arrow-down"
/>
<span class="collapse"
@click="collapseItem(index)">
<i :class="{'move':!formItem.show}"
class="arrow el-icon-arrow-down" />
{{ formItem.show?'收起':'展开' }} </span>
</p>
<el-collapse-transition>
<viewDetail
:is-get-detail="false"
v-if="formItem.show"
:merchant-info="formItem"
:view-detail-visible="formItem.show"
/>
<viewDetail :is-get-detail="false"
v-if="formItem.show"
:merchant-info="formItem"
:view-detail-visible="formItem.show" />
</el-collapse-transition>
</div>
</div>
<div
v-else
class="nothingtips"
>
<img
style="height: 109px; width: 109px;"
src="../images/empty.png"
>
<div v-else
class="nothingtips">
<img style="height: 109px; width: 109px;"
src="../images/empty.png">
<p class="title">
暂无财务规则
</p>
......
......@@ -282,7 +282,7 @@
<script>
import { Util, returnFloat } from '@/common/util'
import { deepClone } from '@/libs/util'
// import { deepClone } from '@/libs/util'
// import { Util, deepClone, returnFloat } from '@/common/util'
import { getAccountRule, getDivisionRuleApi, entrydateUpdate } from '@api/merchant'
// deductChargeFlagObj
......@@ -424,7 +424,7 @@ export default {
} else {
this.setAccountRule(this.merchantInfo.settleRule)
console.log(this.merchantInfo.divisionRule)
this.setDivisionRule(deepClone(this.merchantInfo.divisionRule))
this.setDivisionRule(Util.deepClone(this.merchantInfo.divisionRule))
// const res = Object.assign(this.merchantInfo.settleRule, this.merchantInfo.divisionRule)
// this.setDivisionRule(res)
}
......@@ -490,7 +490,7 @@ export default {
if (val.merchantProfitValue) val.merchantProfitValue = returnFloat(val.merchantProfitValue)
if (val.partnerProfitPer) val.partnerProfitPer = returnFloat(val.partnerProfitPer)
})
this.settleRuleList = deepClone(res.goodsTypeSettleRuleList)
this.settleRuleList = Util.deepClone(res.goodsTypeSettleRuleList)
// console.log(res.goodsTypeSettleRuleList)
this.merchantInfo.deductChargeFlag = res.deductChargeFlag
this.settleRuleList.unshift({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!