Browse Source

yshop1.6.4后台新增修改订单价格与备注优化订单详情显示明细,修复积分记录标题不显示的问题

master
hupeng 5 years ago
parent
commit
24753759f4
  1. 16
      src/api/yxStoreOrder.js
  2. 49
      src/views/shop/order/detail.vue
  3. 196
      src/views/shop/order/edit.vue
  4. 134
      src/views/shop/order/index.vue
  5. 193
      src/views/shop/order/remark.vue

16
src/api/yxStoreOrder.js

@ -31,6 +31,22 @@ export function refund(data) {
})
}
export function editOrder(data) {
return request({
url: 'api/yxStoreOrder/edit',
method: 'post',
data
})
}
export function remark(data) {
return request({
url: 'api/yxStoreOrder/remark',
method: 'post',
data
})
}
export function get() {
return request({
url: 'api/yxExpress',

49
src/views/shop/order/detail.vue

@ -3,12 +3,11 @@
<el-card>
<div slot="header">
<span>收货信息</span>
<!--<el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>-->
</div>
<div>用户昵称:{{ form.nickname }}</div>
<div>收货人: {{ form.realName }}</div>
<div>联系电话: {{ form.userPhone }}</div>
<div>收货地址: {{ form.userAddress }}</div>
<div class="text item">用户昵称:{{ form.nickname }}</div>
<div class="text item">收货人: {{ form.realName }}</div>
<div class="text item">联系电话: {{ form.userPhone }}</div>
<div class="text item">收货地址: {{ form.userAddress }}</div>
</el-card>
<el-card>
<div slot="header">
@ -16,21 +15,34 @@
</div>
<el-row :gutter="24">
<el-col :span="12">
<div>订单编号: {{ form.orderId }}</div>
<div>商品总数: {{ form.totalNum }}</div>
<div>支付邮费: {{ form.totalPostage }}</div>
<div>实际支付: {{ form.payPrice }}</div>
<div>支付方式: {{ form.payTypeName }}</div>
<div class="text item">订单编号: {{ form.orderId }}</div>
<div class="text item">商品总数: {{ form.totalNum }}</div>
<div class="text item">支付邮费: {{ form.totalPostage }}</div>
<div class="text item">实际支付: {{ form.payPrice }}</div>
<div class="text item">支付方式: {{ form.payTypeName }}</div>
</el-col>
<el-col :span="12">
<div>订单状态: {{ form.statusName }}</div>
<div>商品总价: {{ form.totalPrice }}</div>
<div>优惠券金额: {{ form.couponPrice }}</div>
<div>创建时间: {{ formatTime(form.addTime) }}</div>
<div>支付时间: {{ formatTime(form.payTime) }}</div>
<div class="text item">订单状态: {{ form.statusName }}</div>
<div class="text item">商品总价: {{ form.totalPrice }}</div>
<div class="text item">优惠券金额: {{ form.couponPrice }}</div>
<div class="text item">创建时间: {{ formatTime(form.addTime) }}</div>
<div class="text item">支付时间: {{ formatTime(form.payTime) }}</div>
</el-col>
</el-row>
</el-card>
<el-card>
<div slot="header">
<span>物流信息</span>
</div>
<div class="text item">快递公司:{{ form.deliveryName }}</div>
<div class="text item">快递单号:{{ form.deliveryId }}</div>
</el-card>
<el-card>
<div slot="header">
<span>备注信息</span>
</div>
<div class="text item">{{ form.remark }}</div>
</el-card>
</el-dialog>
</template>
@ -210,5 +222,12 @@ export default {
</script>
<style scoped>
.text {
font-size: 12px;
}
.item {
padding: 6px 0;
}
</style>

196
src/views/shop/order/edit.vue

@ -0,0 +1,196 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="订单号" >
<el-input v-model="form.orderId" :disabled="true" style="width: 370px;" />
</el-form-item>
<el-form-item label="原始邮费" >
<el-input v-model="form.totalPostage" :disabled="true" style="width: 370px;" />
</el-form-item>
<el-form-item label="实际支付" >
<el-input v-model="form.payPrice" style="width: 370px;"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, editOrder } from '@/api/yxStoreOrder'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
orderId: '',
uid: '',
realName: '',
userPhone: '',
userAddress: '',
cartId: '',
freightPrice: '',
totalNum: '',
totalPrice: '',
totalPostage: '',
payPrice: '',
payPostage: '',
deductionPrice: '',
couponId: '',
couponPrice: '',
paid: '',
payTime: '',
payType: '',
addTime: '',
status: '',
refundStatus: '',
refundReasonWapImg: '',
refundReasonWapExplain: '',
refundReasonTime: '',
refundReasonWap: '',
refundReason: '',
refundPrice: '',
deliveryName: '',
deliveryType: '',
deliveryId: '',
gainIntegral: '',
useIntegral: '',
backIntegral: '',
mark: '',
isDel: '',
unique: '',
remark: '',
merId: '',
isMerCheck: '',
combinationId: '',
pinkId: '',
cost: '',
seckillId: '',
bargainId: '',
verifyCode: '',
storeId: '',
shippingType: '',
isChannel: '',
isRemind: '',
isSystemDel: ''
},
rules: {
unique: [
{ required: true, message: 'please enter', trigger: 'blur' }
],
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
editOrder(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
orderId: '',
uid: '',
realName: '',
userPhone: '',
userAddress: '',
cartId: '',
freightPrice: '',
totalNum: '',
totalPrice: '',
totalPostage: '',
payPrice: '',
payPostage: '',
deductionPrice: '',
couponId: '',
couponPrice: '',
paid: '',
payTime: '',
payType: '',
addTime: '',
status: '',
refundStatus: '',
refundReasonWapImg: '',
refundReasonWapExplain: '',
refundReasonTime: '',
refundReasonWap: '',
refundReason: '',
refundPrice: '',
deliveryName: '',
deliveryType: '',
deliveryId: '',
gainIntegral: '',
useIntegral: '',
backIntegral: '',
mark: '',
isDel: '',
unique: '',
remark: '',
merId: '',
isMerCheck: '',
combinationId: '',
pinkId: '',
cost: '',
seckillId: '',
bargainId: '',
verifyCode: '',
storeId: '',
shippingType: '',
isChannel: '',
isRemind: '',
isSystemDel: ''
}
}
}
}
</script>
<style scoped>
</style>

134
src/views/shop/order/index.vue

@ -23,6 +23,8 @@
<eForm ref="form" :is-add="isAdd"/>
<eDetail ref="form1" :is-add="isAdd"/>
<eRefund ref="form2" :is-add="isAdd"/>
<editOrder ref="form3" :is-add="isAdd"/>
<eRemark ref="form4" :is-add="isAdd"/>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="orderId" width="140" label="订单号">
@ -70,6 +72,11 @@
<el-dropdown size="mini" split-button type="primary" trigger="click">
操作
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>
<el-button v-permission="['ADMIN','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']" size="mini" type="success"
@click="remark(scope.row)">
订单备注</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button v-if="scope.row._status == 2" v-permission="['ADMIN','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']" size="mini" type="primary"
@click="edit(scope.row)">
@ -80,7 +87,12 @@
@click="refund(scope.row)">
立刻退款</el-button>
</el-dropdown-item>
<el-dropdown-item v-if="scope.row._status == 1 || scope.row._status == 6 || scope.row._status == 7">
<el-dropdown-item v-if="scope.row._status == 1">
<el-button v-permission="['ADMIN','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']" size="mini" type="primary"
@click="editOrder(scope.row)">
修改订单</el-button>
</el-dropdown-item>
<el-dropdown-item v-if="scope.row._status == 1">
<el-popover
v-permission="['ADMIN','YXSTOREORDER_ALL','YXSTOREORDER_DELETE']"
:ref="scope.row.id"
@ -118,9 +130,11 @@ import { del } from '@/api/yxStoreOrder'
import eForm from './form'
import eDetail from './detail'
import eRefund from './refund'
import editOrder from './edit'
import eRemark from './remark'
import { formatTime } from '@/utils/index'
export default {
components: { eForm, eDetail, eRefund },
components: { eForm, eDetail, eRefund, editOrder, eRemark },
mixins: [initData],
data() {
return {
@ -241,6 +255,122 @@ export default {
}
_this.dialog = true
},
editOrder(data) {
this.isAdd = false
const _this = this.$refs.form3
_this.form = {
id: data.id,
orderId: data.orderId,
uid: data.uid,
realName: data.realName,
userPhone: data.userPhone,
userAddress: data.userAddress,
cartId: data.cartId,
freightPrice: data.freightPrice,
totalNum: data.totalNum,
totalPrice: data.totalPrice,
totalPostage: data.totalPostage,
payPrice: data.payPrice,
payPostage: data.payPostage,
deductionPrice: data.deductionPrice,
couponId: data.couponId,
couponPrice: data.couponPrice,
paid: data.paid,
payTime: data.payTime,
payType: data.payType,
addTime: data.addTime,
status: data.status,
refundStatus: data.refundStatus,
refundReasonWapImg: data.refundReasonWapImg,
refundReasonWapExplain: data.refundReasonWapExplain,
refundReasonTime: data.refundReasonTime,
refundReasonWap: data.refundReasonWap,
refundReason: data.refundReason,
refundPrice: data.refundPrice,
deliveryName: data.deliveryName,
deliveryType: data.deliveryType,
deliveryId: data.deliveryId,
gainIntegral: data.gainIntegral,
useIntegral: data.useIntegral,
backIntegral: data.backIntegral,
mark: data.mark,
isDel: data.isDel,
unique: data.unique,
remark: data.remark,
merId: data.merId,
isMerCheck: data.isMerCheck,
combinationId: data.combinationId,
pinkId: data.pinkId,
cost: data.cost,
seckillId: data.seckillId,
bargainId: data.bargainId,
verifyCode: data.verifyCode,
storeId: data.storeId,
shippingType: data.shippingType,
isChannel: data.isChannel,
isRemind: data.isRemind,
isSystemDel: data.isSystemDel
}
_this.dialog = true
},
remark(data) {
this.isAdd = false
const _this = this.$refs.form4
_this.form = {
id: data.id,
orderId: data.orderId,
uid: data.uid,
realName: data.realName,
userPhone: data.userPhone,
userAddress: data.userAddress,
cartId: data.cartId,
freightPrice: data.freightPrice,
totalNum: data.totalNum,
totalPrice: data.totalPrice,
totalPostage: data.totalPostage,
payPrice: data.payPrice,
payPostage: data.payPostage,
deductionPrice: data.deductionPrice,
couponId: data.couponId,
couponPrice: data.couponPrice,
paid: data.paid,
payTime: data.payTime,
payType: data.payType,
addTime: data.addTime,
status: data.status,
refundStatus: data.refundStatus,
refundReasonWapImg: data.refundReasonWapImg,
refundReasonWapExplain: data.refundReasonWapExplain,
refundReasonTime: data.refundReasonTime,
refundReasonWap: data.refundReasonWap,
refundReason: data.refundReason,
refundPrice: data.refundPrice,
deliveryName: data.deliveryName,
deliveryType: data.deliveryType,
deliveryId: data.deliveryId,
gainIntegral: data.gainIntegral,
useIntegral: data.useIntegral,
backIntegral: data.backIntegral,
mark: data.mark,
isDel: data.isDel,
unique: data.unique,
remark: data.remark,
merId: data.merId,
isMerCheck: data.isMerCheck,
combinationId: data.combinationId,
pinkId: data.pinkId,
cost: data.cost,
seckillId: data.seckillId,
bargainId: data.bargainId,
verifyCode: data.verifyCode,
storeId: data.storeId,
shippingType: data.shippingType,
isChannel: data.isChannel,
isRemind: data.isRemind,
isSystemDel: data.isSystemDel
}
_this.dialog = true
},
refund(data) {
this.isAdd = false
const _this = this.$refs.form2

193
src/views/shop/order/remark.vue

@ -0,0 +1,193 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="订单号" >
<el-input v-model="form.orderId" :disabled="true" style="width: 370px;" />
</el-form-item>
<el-form-item label="订单备注" >
<el-input v-model="form.remark" style="width: 370px;" rows="5" type="textarea"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, remark } from '@/api/yxStoreOrder'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
orderId: '',
uid: '',
realName: '',
userPhone: '',
userAddress: '',
cartId: '',
freightPrice: '',
totalNum: '',
totalPrice: '',
totalPostage: '',
payPrice: '',
payPostage: '',
deductionPrice: '',
couponId: '',
couponPrice: '',
paid: '',
payTime: '',
payType: '',
addTime: '',
status: '',
refundStatus: '',
refundReasonWapImg: '',
refundReasonWapExplain: '',
refundReasonTime: '',
refundReasonWap: '',
refundReason: '',
refundPrice: '',
deliveryName: '',
deliveryType: '',
deliveryId: '',
gainIntegral: '',
useIntegral: '',
backIntegral: '',
mark: '',
isDel: '',
unique: '',
remark: '',
merId: '',
isMerCheck: '',
combinationId: '',
pinkId: '',
cost: '',
seckillId: '',
bargainId: '',
verifyCode: '',
storeId: '',
shippingType: '',
isChannel: '',
isRemind: '',
isSystemDel: ''
},
rules: {
unique: [
{ required: true, message: 'please enter', trigger: 'blur' }
],
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
remark(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
orderId: '',
uid: '',
realName: '',
userPhone: '',
userAddress: '',
cartId: '',
freightPrice: '',
totalNum: '',
totalPrice: '',
totalPostage: '',
payPrice: '',
payPostage: '',
deductionPrice: '',
couponId: '',
couponPrice: '',
paid: '',
payTime: '',
payType: '',
addTime: '',
status: '',
refundStatus: '',
refundReasonWapImg: '',
refundReasonWapExplain: '',
refundReasonTime: '',
refundReasonWap: '',
refundReason: '',
refundPrice: '',
deliveryName: '',
deliveryType: '',
deliveryId: '',
gainIntegral: '',
useIntegral: '',
backIntegral: '',
mark: '',
isDel: '',
unique: '',
remark: '',
merId: '',
isMerCheck: '',
combinationId: '',
pinkId: '',
cost: '',
seckillId: '',
bargainId: '',
verifyCode: '',
storeId: '',
shippingType: '',
isChannel: '',
isRemind: '',
isSystemDel: ''
}
}
}
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save