Compare commits

..

8 Commits

Author SHA1 Message Date
tk
9e36a0bd1c 【类 型】:refactor
【主	题】:订单模块 重构
【描	述】:
	[原因]:订单页面 销售统计页面 数据请求 在加载页面时再请求 对应条件数据
	[过程]:
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
2024-07-01 21:08:03 +08:00
tk
b92d305678 【类 型】:refactor
【主	题】:重构了日期组件
【描	述】:
	[原因]:初始化值 并vuex实时记录其 日期
	[过程]:初始化为今天 同步到vuex
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
2024-07-01 18:06:09 +08:00
tk
81c9229993 【类 型】:feat
【主	题】:退款 弹出确认控件
【描	述】:
	[原因]:确认退款 并且增加 退款金额表单
	[过程]:确认退款 并且增加 退款金额表单
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
2024-07-01 16:44:13 +08:00
tk
91cab38b6f 【类 型】:chore
【主	题】:组件更名
【描	述】:
	[原因]:
	[过程]:
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
2024-07-01 16:42:12 +08:00
tk
fddd14b5c2 【类 型】:refactor
【主	题】:订单主状态 选择组件  更名
【描	述】:
	[原因]:数据库字段名称 保持一致
	[过程]:
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
2024-07-01 16:37:06 +08:00
tk
85562d96eb 【类 型】:refactor
【主	题】:退款状态选择组件 更名
【描	述】:
	[原因]:
	[过程]:
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
2024-07-01 16:35:17 +08:00
tk
2a97199f85 【类 型】:refactor
【主	题】:添加  "任务状态" 选择组件
【描	述】:
	[原因]:
	[过程]:
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
2024-07-01 16:34:01 +08:00
tk
b28e2926bb 【类 型】:refactor
【主	题】:搜索缓存 增加 “执行状态”
【描	述】:
	[原因]:根据数据字段更改 增加执行状态
	[过程]:
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
2024-07-01 16:22:57 +08:00
10 changed files with 221 additions and 187 deletions

View File

@ -6,14 +6,6 @@
<script>
export default {
props: {
startDate: {
type: Number
},
endDate: {
type: Number
}
},
data () {
return {
pickerOptions: {
@ -87,22 +79,37 @@ export default {
}
]
},
value: [new Date(this.startDate * 1000), new Date(this.endDate * 1000)]
value: []
}
},
created () {
const startTime = this.$store.getters['app/getOrderSerch'].start_time
const endTime = this.$store.getters['app/getOrderSerch'].end_time
if (startTime === '' && endTime === '') {
this.value = [
new Date(new Date().setHours(0, 0, 0, 0)).getTime(),
new Date(new Date().setHours(23, 59, 59, 999)).getTime()
]
this.$store.commit('app/setOrderSerch', { start_time: startTime, end_time: endTime })
} else {
this.value = [
new Date(startTime * 1000),
new Date(endTime * 1000)
]
}
},
watch: {
value (newVal) {
if (newVal && newVal.length === 2) {
const end = newVal[1]
const start = new Date(newVal[0])
const end = new Date(newVal[1])
end.setHours(23, 59, 59, 999) // 23:59:59
const startTimestamp = Math.floor(newVal[0].getTime() / 1000) //
const startTimestamp = Math.floor(start.getTime() / 1000) //
const endTimestamp = Math.floor(end.getTime() / 1000) //
this.$store.commit('app/setOrderSerch', { start_time: startTimestamp })
this.$store.commit('app/setOrderSerch', { end_time: endTimestamp })
}
if (newVal === null) {
this.$store.commit('app/setOrderSerch', { start_time: '' })
this.$store.commit('app/setOrderSerch', { end_time: '' })
this.$store.commit('app/setOrderSerch', { start_time: startTimestamp, end_time: endTimestamp })
} else if (newVal === null) {
this.$store.commit('app/setOrderSerch', { start_time: '', end_time: '' })
}
}
}

View File

@ -149,17 +149,23 @@ export default {
},
methods: {
questAss, //
/**
* @description: 封装退款函数 同步后续操作
* @param {*} refundOrderSn 订单编号
* @param {*} refundShopId 商铺id
* @param {*} refundPrice 退款金额
* @param {*} refundType 退款类型 'buyer'买家申请 'seller'卖家主动
*/
refund (refundOrderSn, refundShopId, refundPrice, refundType) {
refund(refundOrderSn, refundShopId, refundPrice, refundType).then(res => {
if (res.data.status === 1) {
this.dialogVisible = false
this.refundIndex = this.tempRefundIndex
if (res.data.status === 1) { // 退
this.dialogVisible = false // 退
this.refundIndex = this.tempRefundIndex // 退 便ui
}
})
}, // 退
parseTime, //
setRefundItem (item, index, refundType) {
console.log(item)
this.tempRefundIndex = index
this.refundTotal_price = item.total_price
this.refundApply_price = item.apply_price

View File

@ -0,0 +1,36 @@
<template>
<el-select class="w-100" v-model="value" multiple placeholder="订单状态:可多选,空显示全部">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</template>
<script>
export default {
data () {
return {
options: [{
value: '未付款',
label: '未付款'
}, {
value: '已付款',
label: '已付款'
}, {
value: '已退款',
label: '已退款'
}, {
value: '已完成',
label: '已完成'
}],
value: this.$store.getters['app/getOrderSerch'].main_status
}
},
watch: {
value (val) {
this.$store.commit('app/setOrderSerch', { main_status: val })
}
}
}
</script>
<style lang="scss" scoped></style>

View File

@ -1,39 +0,0 @@
<template>
<el-select class="w-100" v-model="value" multiple placeholder="退款状态过滤:可多选过滤条件(空置显示全部状态订单)">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</template>
<script>
export default {
data () {
return {
options: [{
value: 'normal',
label: '从未申请'
}, {
value: 'requested',
label: '申请退款中'
}, {
value: 'refunded',
label: '已退款'
}, {
value: 'rejected',
label: '拒绝退款'
}, {
value: 'actively',
label: '商家发起退款'
}],
value: this.$store.getters['app/getOrderSerch'].back
}
},
watch: {
value (val) {
this.$store.commit('app/setOrderSerch', { back: val })
}
}
}
</script>
<style lang="scss" scoped></style>

View File

@ -1,42 +0,0 @@
<template>
<el-select class="w-100" v-model="value" multiple placeholder="订单状态过滤:可多选过滤条件(空置显示全部状态订单)">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</template>
<script>
export default {
data () {
return {
options: [{
value: 'unpaid',
label: '未付款'
}, {
value: 'pending',
label: '待处理'
}, {
value: 'processing',
label: '备货处理中'
}, {
value: 'shipped',
label: '已发货'
}, {
value: 'completed',
label: '已送达'
}, {
value: 'closed',
label: '交易关闭'
}],
value: this.$store.getters['app/getOrderSerch'].status
}
},
watch: {
value (val) {
this.$store.commit('app/setOrderSerch', { status: val })
}
}
}
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,40 @@
<template>
<el-select class="w-100" v-model="value" multiple placeholder="退款状态:可多选,空显示全部">
<template slot="prepend">Http://</template>
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</template>
<script>
export default {
data () {
return {
options: [{
value: '未申请',
label: '未申请'
}, {
value: '申请中',
label: '申请中'
}, {
value: '已同意',
label: '同意买家申请'
}, {
value: '主动退',
label: '卖家主动退款'
}, {
value: '拒绝退',
label: '拒绝退款'
}],
value: this.$store.getters['app/getOrderSerch'].refund_status
}
},
watch: {
value (val) {
this.$store.commit('app/setOrderSerch', { refund_status: val })
}
}
}
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,36 @@
<template>
<el-select class="w-100" v-model="value" multiple placeholder="执行状态:可多选,空显示全部">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</template>
<script>
export default {
data () {
return {
options: [{
value: '未接单',
label: '未接单'
}, {
value: '已接单',
label: '已接单'
}, {
value: '已发货',
label: '已发货'
}, {
value: '已送达',
label: '已送达'
}],
value: this.$store.getters['app/getOrderSerch'].shipment_status
}
},
watch: {
value (val) {
this.$store.commit('app/setOrderSerch', { shipment_status: val })
}
}
}
</script>
<style lang="scss" scoped></style>

View File

@ -66,10 +66,12 @@ const getters = {
// 获取订单页面搜索条件
getOrderSerch (state) {
const defaultValues = {
start_time: '', // 搜索条件 起始时间
end_time: '', // 搜索条件 结束时间
status: [], // 搜索条件 订单状态
back: [], // 搜索条件 退款状态
shop_id: '', // 搜索条件 商铺id
start_time: Math.floor(new Date(new Date().setHours(0, 0, 0, 0)).getTime() / 1000), // 搜索条件 起始时间 默认为今天凌晨0点
end_time: Math.floor(new Date(new Date().setHours(23, 59, 59, 999)).getTime() / 1000), // 搜索条件 结束时间 默认为今天23点59分59秒
main_status: [], // 搜索条件 主状态
shipment_status: [], // 搜索条件 执行状态
refund_status: [], // 搜索条件 退款状态
search: ['orderId', '']// 搜索条件 搜索
}
// 深层合并 state.orderSerch 和默认值 取值得时候对象里面如果有得属性 会被保留 没有得会用defaultValues的属性进行填充

View File

@ -26,11 +26,11 @@ export async function apiCrosFrequency (params) {
* @param {*} val 修改字段的值
*/
export function questAss (id, state, val) {
const data = new URLSearchParams()// post对象参数 转成 字符串连接
data.append('id', id)
data.append('state', state)
data.append('val', val)
api.post('questAss', data).then(res => {
const params = new URLSearchParams()// post对象参数 转成 字符串连接
params.append('id', id)
params.append('state', state)
params.append('val', val)
api.post('questAss', params).then(res => {
if (res.data.status === 1) {
Message.success(res.data.msg)
store.dispatch('fetchPaidOrderList')// 更新订单列表
@ -40,6 +40,28 @@ export function questAss (id, state, val) {
}
})
}
/**
* @description: 获取订单列表
* @param {*} orderSerch 搜索条件
*/
export async function getOrderList (orderSerch) {
const params = new URLSearchParams()// post对象参数 转成 字符串连接
params.append('shop_id', orderSerch.shop_id)
params.append('start_time', orderSerch.start_time)
params.append('end_time', orderSerch.end_time)
params.append('main_status', orderSerch.main_status)
params.append('shipment_status', orderSerch.shipment_status)
params.append('refund_status', orderSerch.refund_status)
params.append('search', orderSerch.search)
// 发送退款请求
const res = await api.post('getOrderList', params, 'Admin')
if (res.data.status === 1) {
Message.success('成功获取订单列表')
} else {
Message.error('获取订单列表失败')
}
return res
}
/**
* @description: 退款函数

View File

@ -6,23 +6,26 @@
<SelectionShopId class="w-100" v-model="shop_id" :allSel="true" />
</el-col>
<el-col :span="8">
<DatePickerOrder class="w-100" :startDate="startDate" :endDate="endDate" />
<DatePickerOrder class="w-100" />
</el-col>
<el-col :span="12">
<SearchOrder class="w-100" />
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :span="12">
<SelectionOrderStatus />
<el-col :span="8">
<SelectionMainStatus />
</el-col>
<el-col :span="12">
<SelectionOrderBack />
<el-col :span="8">
<SelectionShipmentStatus />
</el-col>
<el-col :span="8">
<SelectionRefundStatus />
</el-col>
</el-row>
<!-- 订单列表 -->
<!-- <el-table class="m-t-20 w-100" ref="myTable"
:data="orderListArr.slice((currentPage - 1) * pageSize, currentPage * pageSize)" border tooltip-effect="dark">
:data="orderList.slice((currentPage - 1) * pageSize, currentPage * pageSize)" border tooltip-effect="dark">
<el-table-column align="center" type="selection" width="40">
</el-table-column>
<el-table-column align="center" prop="id" label="id" width="50">
@ -49,7 +52,7 @@
</el-table> -->
<!-- 分页 -->
<!-- <el-pagination class="m-t-20" layout="prev, pager, next" :current-page.sync="currentPage" :page-size="pageSize"
:total="orderListArr.length">
:total="orderList.length">
</el-pagination> -->
</div>
</template>
@ -57,9 +60,11 @@
<script>
import { countSelIdArr, parseTime } from '@/utils'
import { getOrderList } from '@/utils/api/table'
import SelectionShopId from '@/components/SelectionShopId'
import SelectionOrderStatus from '@/components/SelectionOrderStatus'
import SelectionOrderBack from '@/components/SelectionOrderBack'
import SelectionMainStatus from '@/components/SelectionMainStatus'
import SelectionShipmentStatus from '@/components/SelectionShipmentStatus'
import SelectionRefundStatus from '@/components/SelectionRefundStatus'
import DatePickerOrder from '@/components/DatePickerOrder'
import SearchOrder from '@/components/SearchOrder'
@ -74,85 +79,46 @@ export default {
},
components: {
SelectionShopId,
SelectionOrderStatus,
SelectionOrderBack,
SelectionMainStatus,
SelectionShipmentStatus,
SelectionRefundStatus,
DatePickerOrder,
SearchOrder
},
computed: {
startDate () {
return Math.floor(new Date(new Date().setHours(0, 0, 0, 0)).getTime() / 1000)
/**
* @description: 订单列表
*/
orderList () {
return []
},
endDate () {
return Math.floor(new Date(new Date().setHours(23, 59, 59, 999)).getTime() / 1000)
/**
* @description: 搜索条件 集合
*/
orderSerch () {
return this.$store.getters['app/getOrderSerch']
}
//
// orderList () {
// return this.$store.state.orderList
// },
// // ( )
// orderSerch () {
// return this.$store.getters['app/getOrderSerch']
// },
// //
// orderListArr () {
// if (this.orderList.length > 0) {
// let filteredList = this.orderList
// // shop_id
// if (this.shop_id !== '') {
// filteredList = filteredList.filter(order => order.shop_id === this.shop_id)
// }
// //
// if (this.orderSerch.start_time !== '' && this.orderSerch.end_time !== '') {
// const startTime = parseInt(this.orderSerch.start_time)
// const endTime = parseInt(this.orderSerch.end_time)
// filteredList = filteredList.filter(order => {
// const orderTime = parseInt(order.addtime)
// return startTime < orderTime && orderTime < endTime
// })
// }
// //
// if (this.orderSerch.status.length > 0) {
// filteredList = filteredList.filter(order => {
// // this.status
// return this.orderSerch.status.includes(order.status)
// })
// }
// //
// if (this.orderSerch.back.length > 0) {
// filteredList = filteredList.filter(order => {
// // this.status
// return this.orderSerch.back.includes(order.back)
// })
// }
// //
// if (this.orderSerch.search[1] !== '') {
// filteredList = filteredList.filter(order => {
// if (this.orderSerch.search[0] === 'orderId') {
// return order.order_sn.indexOf(this.orderSerch.search[1]) >= 0
// } else if (this.orderSerch.search[0] === 'name') {
// return order.receiver.indexOf(this.orderSerch.search[1]) >= 0
// } else if (this.orderSerch.search[0] === 'tel') {
// return order.tel.indexOf(this.orderSerch.search[1]) >= 0
// } else if (this.orderSerch.search[0] === 'remark') {
// return order.remark.indexOf(this.orderSerch.search[1]) >= 0
// } else if (this.orderSerch.search[0] === 'desc') {
// return order.describe.indexOf(this.orderSerch.search[1]) >= 0
// }
// })
// }
// return filteredList
// } else {
// return []
// }
// }
},
methods: {
countSelIdArr
countSelIdArr,
/**
* @description: 根据 缓存的搜索条件 获取订单列表
*/
async getOrderList (orderSerch) {
const res = await getOrderList(orderSerch)
console.log(res)
}
},
watch: {
// shop_id (val) {
// this.$store.commit('app/setOrderSerch', { shop_id: val })
// },
orderSerch (val) {
this.getOrderList(val)
}
},
created () {
},
filters: {
countSelIdArr,