Commit 59aef07d by cwq0219

bug修复

1 parent 768080ea
...@@ -2,18 +2,23 @@ ...@@ -2,18 +2,23 @@
* @Author: limin * @Author: limin
* @Date: 2019-08-26 18:02:49 * @Date: 2019-08-26 18:02:49
* @Last Modified by: chenwq * @Last Modified by: chenwq
* @Last Modified time: 2020-11-27 22:22:25 * @Last Modified time: 2021-06-16 14:19:46
*/ */
import sha1 from 'sha1' import sha1 from 'sha1'
import qs from 'qs' import qs from 'qs'
const secret = window.location.href.includes('dj.glsx.com.cn') ? '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353' : 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b' const secret = window.location.href.includes('dj.glsx.com.cn') ? '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353' : 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const sign = (params, noSignAttr = []) => { const sign = (params, noSignAttr = []) => {
delete params.sign delete params.sign
var objStr = qs.stringify(_.cloneDeep(params), { arrayFormat: 'indices', encode: false, allowDots: true }) var objStr = qs.stringify(_.cloneDeep(params), {
arrayFormat: 'indices',
allowDots: true,
encodeValuesOnly: true
})
var objVal = objStr.split('&') var objVal = objStr.split('&')
var realObj = {} var realObj = {}
objVal.forEach(item => { objVal.forEach(item => {
realObj[item.split('=')[0]] = item.split('=')[1] const idx = item.indexOf('=')
realObj[item.split('=')[0]] = decodeURIComponent(item.slice(idx + 1))
}) })
const keys = Object.keys(realObj).sort() const keys = Object.keys(realObj).sort()
var str = [] var str = []
......
...@@ -209,6 +209,7 @@ export default { ...@@ -209,6 +209,7 @@ export default {
var targetItem = this.proList.find(item => item.goodsCode === value) var targetItem = this.proList.find(item => item.goodsCode === value)
this.proInfo.goodsName = targetItem.goodsName this.proInfo.goodsName = targetItem.goodsName
this.proInfo.goodsCode = targetItem.goodsCode this.proInfo.goodsCode = targetItem.goodsCode
this.proInfo.sapCode = targetItem.sapCode
this.proInfo.thumbUrl = targetItem.thumbUrl this.proInfo.thumbUrl = targetItem.thumbUrl
this.proInfo.goodsTypeName = targetItem.goodsTypeName this.proInfo.goodsTypeName = targetItem.goodsTypeName
}, },
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
@change="handleCheckedChange" @change="handleCheckedChange"
> >
<el-checkbox <el-checkbox
v-for="item in optionList" v-for="item in baseData[optionConfig.searchItemName]"
:label="item[optionConfig.optionId]" :label="item[optionConfig.optionId]"
:key="item[optionConfig.optionId]" :key="item[optionConfig.optionId]"
@change="handleCheckedChange" @change="handleCheckedChange"
...@@ -64,9 +64,14 @@ export default { ...@@ -64,9 +64,14 @@ export default {
default: () => { } default: () => { }
}, },
// 多选列表 // 多选列表
optionList: { // optionList: {
type: Array, // type: Array,
default: () => [] // default: () => []
// },
// 多选列表Obj
baseData: {
type: Object,
default: () => { }
} }
}, },
...@@ -79,12 +84,12 @@ export default { ...@@ -79,12 +84,12 @@ export default {
handleCheckedChange(value) { handleCheckedChange(value) {
const checkedCount = value.length const checkedCount = value.length
this.checkAll = checkedCount === this.optionList.length this.checkAll = checkedCount === this.baseData[this.optionConfig.searchItemName].length
this.isIndeterminate = checkedCount > 0 && checkedCount < this.optionList.length this.isIndeterminate = checkedCount > 0 && checkedCount < this.baseData[this.optionConfig.searchItemName].length
}, },
handleCheckAllChange(val) { handleCheckAllChange(val) {
this.checkedList = val ? this.optionList.map(item => item[this.optionConfig.optionId]) : [] this.checkedList = val ? this.baseData[this.optionConfig.searchItemName].map(item => item[this.optionConfig.optionId]) : []
this.isIndeterminate = false this.isIndeterminate = false
}, },
......
...@@ -40,10 +40,10 @@ ...@@ -40,10 +40,10 @@
<template slot="header"> <template slot="header">
<span>{{item.label}}</span> <span>{{item.label}}</span>
<table-head-search <table-head-search
v-if="item.optionList" v-show="item.optionConfig"
:searchForm="searchForm" :searchForm="headSearchForm"
:optionConfig="item.optionConfig" :optionConfig="item.optionConfig"
:optionList="item.optionList" :baseData="baseData"
@handleTableHeadChange="handleTableHeadChange" @handleTableHeadChange="handleTableHeadChange"
></table-head-search> ></table-head-search>
</template> </template>
...@@ -146,6 +146,17 @@ export default { ...@@ -146,6 +146,17 @@ export default {
type: Object, type: Object,
default: () => { } default: () => { }
}, },
// 表格头部搜索条件 - start
headSearchForm: {
type: Object,
default: () => { }
},
// 选项列表Obj
baseData: {
type: Object,
default: () => {}
},
// 表格头部搜索条件 - end
// 表格数据-外部传入 // 表格数据-外部传入
tableData: { tableData: {
type: Array, type: Array,
......
...@@ -83,16 +83,16 @@ ...@@ -83,16 +83,16 @@
align="center" align="center"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{!scope.row.firstOrderPay ? '' : (!scope.row.firstOrderPay.successDate ? '' : new Date(scope.row.firstOrderPay.successDate).toLocaleDateString())}}</span> <span>{{!scope.row.orderPay ? '' : (!scope.row.orderPay.successDate ? '' : new Date(scope.row.orderPay.successDate).toLocaleDateString())}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="备注信息" label="备注信息"
align="center" align="center"
prop="firstOrder.remark" prop="order.remark"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.firstOrder ? '无' : (scope.row.firstOrder.remark || '无')}}</span> <span>{{scope.row.order ? (scope.row.order.upgradeFlag === 'N' ? (scope.row.order.customer ? (scope.row.order.customer.refusalReason || '无') : '无') : (scope.row.order.remark || '无')) : '无'}}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
...@@ -107,7 +107,11 @@ ...@@ -107,7 +107,11 @@
label="推荐人" label="推荐人"
align="center" align="center"
prop="employeeName" prop="employeeName"
></el-table-column> >
<template slot-scope="scope">
<span>{{scope.row.order ? scope.row.order.employeeName : ''}}</span>
</template>
</el-table-column>
<el-table-column <el-table-column
label="园区店" label="园区店"
align="center" align="center"
...@@ -117,7 +121,7 @@ ...@@ -117,7 +121,7 @@
<el-table-column <el-table-column
label="转化专员" label="转化专员"
align="center" align="center"
prop="firstOrder.sellerName" prop="order.sellerName"
></el-table-column> ></el-table-column>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -133,7 +137,7 @@ ...@@ -133,7 +137,7 @@
prop="source" prop="source"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.source === 3 ? '现场升级' : (scope.row.source === 5 ? '核销抵扣' : '系统录入')}}</span> <span>{{scope.row.order ? (scope.row.order.source === 3 ? '现场升级' : (scope.row.order.source === 5 ? '核销抵扣' : '系统录入')): (scope.row.source === 3 ? '现场升级' : (scope.row.source === 5 ? '核销抵扣' : '系统录入'))}}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
<d2-table <d2-table
ref="couponsDetailTable" ref="couponsDetailTable"
:hasNum="false" :hasNum="false"
:baseData="baseData"
:sortObj="sortObj" :sortObj="sortObj"
:searchForm="searchForm" :searchForm="searchFormSearch"
:headSearchForm="searchForm"
:tableParams="tableParams" :tableParams="tableParams"
:getListApi="getListApi" :getListApi="getListApi"
:beforeSearchFn="beforeSearchFn" :beforeSearchFn="beforeSearchFn"
...@@ -14,7 +16,7 @@ ...@@ -14,7 +16,7 @@
<span <span
slot="couponName" slot="couponName"
slot-scope="scope" slot-scope="scope"
>{{scope.scope.couponName}}({{scope.scope.customerCouponCode}})</span></d2-table> >{{scope.scope.couponName}}{{scope.scope.customerCouponCode}}</span></d2-table>
</div> </div>
</template> </template>
...@@ -73,8 +75,8 @@ export default { ...@@ -73,8 +75,8 @@ export default {
searchItemName: 'employeeNameList', searchItemName: 'employeeNameList',
optionId: 'confId', optionId: 'confId',
optionLabel: 'confValue' optionLabel: 'confValue'
}, }
optionList: [] // optionList: []
}, { }, {
label: '核销状态', label: '核销状态',
prop: 'usedFlag', prop: 'usedFlag',
...@@ -89,8 +91,8 @@ export default { ...@@ -89,8 +91,8 @@ export default {
searchItemName: 'usedFlagList', searchItemName: 'usedFlagList',
optionId: 'confId', optionId: 'confId',
optionLabel: 'confValue' optionLabel: 'confValue'
}, }
optionList: [{ confValue: '待核销', confId: 'N' }, { confValue: '已核销', confId: 'Y' }] // optionList: [{ confValue: '待核销', confId: 'N' }, { confValue: '已核销', confId: 'Y' }]
}, { }, {
label: '核销人', label: '核销人',
prop: 'sellerName', prop: 'sellerName',
...@@ -98,8 +100,8 @@ export default { ...@@ -98,8 +100,8 @@ export default {
searchItemName: 'sellerNameList', searchItemName: 'sellerNameList',
optionId: 'confId', optionId: 'confId',
optionLabel: 'confValue' optionLabel: 'confValue'
}, }
optionList: [] // optionList: []
}, { }, {
label: '核销时间', label: '核销时间',
prop: 'usedTime', prop: 'usedTime',
...@@ -109,6 +111,12 @@ export default { ...@@ -109,6 +111,12 @@ export default {
return cellValue.usedTime ? Util.dateFormate(cellValue.usedTime, 'YYYY-MM-DD HH:mm:ss') : '' return cellValue.usedTime ? Util.dateFormate(cellValue.usedTime, 'YYYY-MM-DD HH:mm:ss') : ''
} }
}] }]
},
// 基本数据
baseData: {
employeeNameList: [],
sellerNameList: [],
usedFlagList: [{ confValue: '待核销', confId: 'N' }, { confValue: '已核销', confId: 'Y' }]
} }
} }
}, },
...@@ -121,13 +129,13 @@ export default { ...@@ -121,13 +129,13 @@ export default {
}, },
mounted() { mounted() {
this.getDistinctColumList(1, 'employeeName') this.getDistinctColumList(1, 'employeeNameList')
this.getDistinctColumList(2, 'sellerName') this.getDistinctColumList(2, 'sellerNameList')
}, },
methods: { methods: {
// columType属性类型(1:发券人;2:转化人) // columType属性类型(1:发券人;2:转化人)
getDistinctColumList(columType, tableColumnsProp) { getDistinctColumList(columType, listName) {
getDistinctColum({ columType: columType, currentPage: 1, pageSize: 100 }).then(res => { getDistinctColum({ columType: columType, currentPage: 1, pageSize: 100 }).then(res => {
var tempArr = [] var tempArr = []
res.forEach(item => { res.forEach(item => {
...@@ -136,7 +144,8 @@ export default { ...@@ -136,7 +144,8 @@ export default {
confValue: item confValue: item
}) })
}) })
this.tableParams.tableColumns[this.findFormIdx(tableColumnsProp)].optionList = tempArr this.baseData[listName] = tempArr
// this.tableParams.tableColumns[this.findFormIdx(tableColumnsProp)].optionList = tempArr
}) })
}, },
// 找到在formList的位置,通过name来匹配 // 找到在formList的位置,通过name来匹配
...@@ -146,14 +155,13 @@ export default { ...@@ -146,14 +155,13 @@ export default {
// 表格头部搜索-改变 // 表格头部搜索-改变
handleTableHeadChange({ searchItemName, checkedList }) { handleTableHeadChange({ searchItemName, checkedList }) {
this.searchForm[searchItemName] = _.cloneDeep(checkedList) this.searchForm[searchItemName] = _.cloneDeep(checkedList)
this.keyDowmGetList()
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.searchFormSearch = { this.searchFormSearch = {
condition: { ...this.parentSearchForm,
...this.parentSearchForm, ...this.searchForm
...this.searchForm
}
} }
resolve() resolve()
}) })
......
...@@ -105,7 +105,7 @@ export default { ...@@ -105,7 +105,7 @@ export default {
methods: { methods: {
handleSearch() { handleSearch() {
console.log(this.activeName) // console.log(this.activeName)
this.$refs[this.activeName].keyDowmGetList() this.$refs[this.activeName].keyDowmGetList()
}, },
......
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
<d2-table <d2-table
ref="couponsTable" ref="couponsTable"
:hasNum="false" :hasNum="false"
:baseData="baseData"
:sortObj="sortObj" :sortObj="sortObj"
:searchForm="searchForm" :searchForm="searchFormSearch"
:headSearchForm="searchForm"
:tableParams="tableParams" :tableParams="tableParams"
:getListApi="getListApi" :getListApi="getListApi"
:beforeSearchFn="beforeSearchFn" :beforeSearchFn="beforeSearchFn"
...@@ -85,8 +87,8 @@ export default { ...@@ -85,8 +87,8 @@ export default {
searchItemName: 'couponTypeList', searchItemName: 'couponTypeList',
optionId: 'goodsType', optionId: 'goodsType',
optionLabel: 'goodsTypeName' optionLabel: 'goodsTypeName'
}, }
optionList: [] // optionList: []
}, { }, {
label: '区域', label: '区域',
parentProp: 'yqMerchantInfo', parentProp: 'yqMerchantInfo',
...@@ -95,8 +97,8 @@ export default { ...@@ -95,8 +97,8 @@ export default {
searchItemName: 'regionList', searchItemName: 'regionList',
optionId: 'confKey', optionId: 'confKey',
optionLabel: 'confValue' optionLabel: 'confValue'
}, }
optionList: [] // optionList: []
}, { }, {
label: '门店名称', label: '门店名称',
prop: 'merchantName' prop: 'merchantName'
...@@ -127,7 +129,7 @@ export default { ...@@ -127,7 +129,7 @@ export default {
optionId: 'confId', optionId: 'confId',
optionLabel: 'confLabel' optionLabel: 'confLabel'
}, },
optionList: [{ confLabel: '启用', confId: 'Y' }, { confLabel: '停用', confId: 'N' }], // optionList: [{ confLabel: '启用', confId: 'Y' }, { confLabel: '停用', confId: 'N' }],
formatter: cellValue => { formatter: cellValue => {
return { return {
'Y': '启用', 'Y': '启用',
...@@ -138,7 +140,10 @@ export default { ...@@ -138,7 +140,10 @@ export default {
}, },
// 基本数据 // 基本数据
baseData: { baseData: {
productTypeList: [] productTypeList: [],
couponTypeList: [],
regionList: [],
enabledFlagList: [{ confLabel: '启用', confId: 'Y' }, { confLabel: '停用', confId: 'N' }]
} }
} }
}, },
...@@ -164,12 +169,15 @@ export default { ...@@ -164,12 +169,15 @@ 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 = _.cloneDeep(await this.get(BaseData.productType))
this.baseData.couponTypeList = _.cloneDeep(await this.get(BaseData.productType))
this.$nextTick() this.$nextTick()
}, },
getCommonConfig() { getCommonConfig() {
commonConfigApi({ confGroup: 'MERCHANT_REGION' }).then(res => { commonConfigApi({ confGroup: 'MERCHANT_REGION' }).then(res => {
this.tableParams.tableColumns[this.findFormIdx('region')].optionList = res // this.tableParams.tableColumns[this.findFormIdx('region')].optionList = res
// console.log(this.tableParams.tableColumns[this.findFormIdx('region')])
this.baseData.regionList = res
this.$nextTick() this.$nextTick()
}) })
}, },
...@@ -181,13 +189,10 @@ export default { ...@@ -181,13 +189,10 @@ export default {
this.$refs.couponsTable.refreshTable() this.$refs.couponsTable.refreshTable()
}, },
beforeSearchFn() { beforeSearchFn() {
console.log(this.parentSearchForm)
return new Promise(resolve => { return new Promise(resolve => {
this.searchFormSearch = { this.searchFormSearch = {
condition: { ...this.parentSearchForm,
...this.parentSearchForm, ...this.searchForm
...this.searchForm
}
} }
resolve() resolve()
}) })
...@@ -196,6 +201,7 @@ export default { ...@@ -196,6 +201,7 @@ export default {
// 表格头部搜索-改变 // 表格头部搜索-改变
handleTableHeadChange({ searchItemName, checkedList }) { handleTableHeadChange({ searchItemName, checkedList }) {
this.searchForm[searchItemName] = _.cloneDeep(checkedList) this.searchForm[searchItemName] = _.cloneDeep(checkedList)
this.keyDowmGetList()
}, },
// 编辑 // 编辑
......
...@@ -86,8 +86,8 @@ ...@@ -86,8 +86,8 @@
prop="nums" prop="nums"
align="center" align="center"
label="数量(件)"> label="数量(件)">
<template> <template slot-scope="scope">
<span>1件</span> <span>{{scope.row.number}}件</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -189,7 +189,7 @@ export default { ...@@ -189,7 +189,7 @@ export default {
mounted() { mounted() {
this.detail = this.$route.params.detail this.detail = this.$route.params.detail
// console.log(this.detail) console.log(this.detail)
}, },
methods: { methods: {
...@@ -221,7 +221,8 @@ export default { ...@@ -221,7 +221,8 @@ export default {
} }
if (index === 1) { if (index === 1) {
sums[index] = this.detail.subOrderList.length + '件' const numberList = this.detail.subOrderList.map(item => item.number)
sums[index] = (numberList.length ? numberList.reduce((preVal, curVal) => { return preVal + curVal }) : '0') + '件'
return return
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!