Commit 7f68e51f by 张立顺

v4.11.0 bug修复

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