Commit 654e0679 by cwq0219

订单管理

1 parent 39f19c11
import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.'
const getListApi = params => {
params.method = `${defaultPath}order.page`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
const getCountApi = params => {
params.method = `${defaultPath}order.count`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getListApi, getCountApi }
\ No newline at end of file \ No newline at end of file
...@@ -66,4 +66,4 @@ const updateShareRecordApi = params => { ...@@ -66,4 +66,4 @@ const updateShareRecordApi = params => {
}) })
} }
export default { getListApi, getShareRecordInfoApi, deleteShareRecordApi, revokeShareRecordApi, addShareRecordApi, updateShareRecordApi } export default { getListApi, getShareRecordInfoApi, deleteShareRecordApi, revokeShareRecordApi, addShareRecordApi, updateShareRecordApi }
\ No newline at end of file \ No newline at end of file
...@@ -56,6 +56,27 @@ html { ...@@ -56,6 +56,27 @@ html {
background: linear-gradient(to right, transparent, #fff 55%); background: linear-gradient(to right, transparent, #fff 55%);
} }
.marketing .list-tips {
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
padding: 10px 16px;
height: 20px;
line-height: 20px;
background-color: #E6E9FF;
border: 1px solid #5850FF;
margin-bottom: 20px;
border-radius: 4px;
}
.marketing .list-tips .tips-img {
vertical-align: middle;
margin: -2px 8px 0 0;
}
.marketing .list-tips .red-txt {
color: #EB4E4E;
}
.marketing .wechat-container { .marketing .wechat-container {
width: 375px; width: 375px;
margin-right: 45px; margin-right: 45px;
......
<!-- 订单管理 --> <!-- 订单管理 -->
<template> <template>
<div class="marketing"> <div class="marketing">
<div class="m-b-20"> <!-- <div class="m-b-20">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新增分类</el-button> <el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新增分类</el-button>
</div> </div>-->
<div class="container"> <div class="container">
<div class="list-tips">
<img class="tips-img" src="@/assets/icon-info.png" />
<span>
已生成有效订单
<span class="red-txt">&nbsp;{{statisticsInfo.orderCount || 0}}&nbsp;</span>项 累计订单总额:
<span class="red-txt">{{statisticsInfo.payPriceTotal || 0}}&nbsp;</span>元
</span>
</div>
<div> <div>
<glsx-combi-form ref="showSearch" labelWidth="90px" :formObj="searchForm" :formData="searchFormData"> <glsx-combi-form
ref="showSearch"
labelWidth="90px"
:formObj="searchForm"
:formData="searchFormData"
>
<span slot="footer" class="footer-btns"> <span slot="footer" class="footer-btns">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button> <el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleReset">重置</el-button> <el-button :size="size" type="primary" @click="handleReset">重置</el-button>
...@@ -15,7 +28,14 @@ ...@@ -15,7 +28,14 @@
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="classifyRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable
ref="classifyRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleEdit(2, scope.scope)">编辑</el-button> <el-button type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> <el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
...@@ -34,62 +54,171 @@ export default { ...@@ -34,62 +54,171 @@ export default {
data() { data() {
return { return {
size: 'small', size: 'small',
oldVal: {
orderStatuses: []
},
searchForm: { searchForm: {
classifyName: '', orderCode: '',
createDate: [] orderStatuses: [],
merchantName: '',
customerName: '',
createDate: [],
orderSource: '',
deliveryType: ''
}, },
tableSearchForm: {}, tableSearchForm: {},
statisticsInfo: {},
// 搜索 // 搜索
searchFormData: [ searchFormData: [
{ {
label: '分类名称', label: '订单编号',
name: 'classifyName', name: 'orderCode',
type: 'input', type: 'input',
maxlength: 20 maxlength: 20
}, },
{ {
label: '创建日期', label: '订单状态',
name: 'orderStatuses',
type: 'select',
multiple: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'orderStatusList',
changeAttr: (value, targetItem) => {
var isAdd = value.length > this.oldVal.orderStatuses.length
var targetVal = value[value.length - 1]
if (!isAdd) {
for(var i = 0; i < this.oldVal.orderStatuses.length; i++) {
if (!value.includes(this.oldVal.orderStatuses[i])) {
targetVal = this.oldVal.orderStatuses[i]
break
}
}
}
!targetVal && (this.searchForm.orderStatuses = isAdd ? this.searchFormData[1].optionList.map(item => item.confId) : [])
if (targetVal) {
var idx = value.findIndex(item => item == '')
if (idx != -1 && this.searchForm.orderStatuses.length < this.searchFormData[1].optionList.length) {
this.searchForm.orderStatuses.splice(idx, 1)
} else if(idx == -1 && this.searchForm.orderStatuses.length == (this.searchFormData[1].optionList.length - 1)) {
this.searchForm.orderStatuses.push('')
}
}
this.oldVal.orderStatuses = this.$common.utils.deepClone(this.searchForm.orderStatuses)
}
},
{
label: '门店',
name: 'merchantName',
type: 'input'
},
{
label: '客户姓名',
name: 'customerName',
type: 'input'
},
{
label: '订单日期',
name: 'createDate', name: 'createDate',
type: 'datePicker', type: 'datePicker',
isClear: true, isClear: true,
pickerOptions: 'beforeRangePickerOptions' pickerOptions: 'beforeRangePickerOptions'
},
{
label: '订单类型',
name: 'orderSource',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'orderSourceList'
},
{
label: '结算方式',
name: 'deliveryType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'deliveryTypeList'
} }
], ],
// 表格 // 表格
getListApi: this.$apis.classifyList.getListApi, getListApi: this.$apis.orderManage.getListApi,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '专区名称', label: '订单编号',
prop: 'classifyName' prop: 'orderCode'
}, },
{ {
label: '创建日期', label: '订单时间',
prop: 'createdDate', prop: 'createdDate',
formatter: cellValue => { formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss') return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
} }
},
{
label: '客户信息',
prop: 'customerName'
},
{
label: '订单状态',
prop: 'orderStatus'
} }
] ]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' } pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 基本数据
baseData: {
orderStatusList: [
{ confId: '1', confName: '未支付' },
// { id: '2', confName: '已支付' },
{ confId: '3', confName: '已失效' },
{ confId: '4', confName: '已发货' },
{ confId: '5', confName: '已收货' },
{ confId: '6', confName: '待审核' },
{ confId: '7', confName: '审核成功' },
{ confId: '8', confName: '审核失败' },
{ confId: '9', confName: '待确认' },
{ confId: '10', confName: '退款中' },
{ confId: '11', confName: '已退款' },
{ confId: '12', confName: '退款失败' },
{ confId: '13', confName: '待发货' },
{ confId: '14', confName: '已安装' }
],
orderSourceList: [
{ confId: '1', confName: '商城订单' },
{ confId: '2', confName: '直播订单' },
{ confId: '3', confName: '活动订单' }
],
deliveryTypeList: [
{ confId: '1', confName: '到店核销' },
{ confId: '2', confName: '快递到家' }
]
}
} }
}, },
mounted() {}, mounted() {
this.getCount()
this.getOptionsList('searchFormData')
},
methods: { methods: {
getParams() { getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.createDate.length) { if (this.searchForm.createDate.length) {
params.startTime = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' params.createdStartDateStr = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59' params.createdEndDateStr = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} }
delete params.createDate delete params.createDate
return params return params
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.tableSearchForm = this.getParams() this.tableSearchForm = this.getParams()
...@@ -98,6 +227,32 @@ export default { ...@@ -98,6 +227,32 @@ export default {
}) })
}, },
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) { secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, { this.$confirm(txt, title, {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -119,6 +274,15 @@ export default { ...@@ -119,6 +274,15 @@ export default {
} }
}) })
}, },
getCount() {
var params = this.getParams()
delete params.createDate
this.$apis.orderManage.getCountApi(params).then(res => {
this.statisticsInfo = res || {}
})
},
// 1-新增;2-编辑 // 1-新增;2-编辑
handleEdit(addOrEdit, row) { handleEdit(addOrEdit, row) {
addOrEdit == 1 ? this.$router.push('/classifyList/editClassify/' + addOrEdit) : this.$router.push('/classifyList/editClassify/' + addOrEdit + '/' + row.id) addOrEdit == 1 ? this.$router.push('/classifyList/editClassify/' + addOrEdit) : this.$router.push('/classifyList/editClassify/' + addOrEdit + '/' + row.id)
...@@ -138,8 +302,13 @@ export default { ...@@ -138,8 +302,13 @@ export default {
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
classifyName: '', orderCode: '',
createDate: [] orderStatuses: [],
merchantName: '',
customerName: '',
createDate: [],
orderSource: '',
deliveryType: ''
} }
this.handleSearch() this.handleSearch()
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!