Commit c2639ddf authored by 杨硕's avatar 杨硕

订单管理

parent 29ea5400
......@@ -9,6 +9,13 @@ export const announcementList = (data) => {
params: data
})
}
/** 根据id查询公告信息详情**/
export function queryannounceDetailById(id) {
return request({
url: '/system/announcement/detail/' + id,
method: 'get'
})
}
// 新增园区公告
export const announcementadd = (data) => {
......
......@@ -29,3 +29,67 @@ export function orderexport(query) {
responseType: 'blob'
})
}
// 退款补偿
export function refundcompensate(query) {
return request({
url: '/system/order/refundReimbursement',
method: 'get',
params: query
})
}
// 支付确认
export function payconfirmation(data) {
return request({
url: '/system/order/payConfirm',
method: 'post',
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
// 退款确认
export function refundconfirmation(data) {
return request({
url: '/system/order/refundConfirm',
method: 'post',
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
// 人工退单
export function manualchargebacks(data) {
return request({
url: '/system/order/cancel',
method: 'post',
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
// 异常订单列表
export function unusualorders(query) {
return request({
url: '/system/order/selectErrorOrderByPagination',
method: 'get',
params: query
})
}
// 异常订单手动补偿
export function unusualorderscompensate(data) {
return request({
url: '/system/order/manualCompensateOrder',
method: 'post',
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
......@@ -69,6 +69,9 @@
</el-select>
</el-form-item>
</div>
<el-form-item label="活动地点" prop="address">
<el-input v-model.trim="form.address" :disabled="formdisable" :maxlength="200" placeholder="请输入活动地点" />
</el-form-item>
<el-form-item label="封面图片" prop="img">
<el-upload
class="upload-demo"
......@@ -209,6 +212,9 @@ export default {
],
source: [
{ required: true, message: '请选择商家名称', trigger: 'change' }
],
address: [
{ required: true, message: '请输入活动地点', trigger: 'blur' }
]
}
}
......@@ -223,11 +229,13 @@ export default {
this.formdisable = false
} else if (this.type === 1) {
this.form = this.$route.query.data
this.style = this.$route.query.data.style
this.imageUrl = baseURL + this.form.imgUrl
this.richtexttype = '1'
this.formdisable = false
} else if (this.type === 2) {
this.form = this.$route.query.data
this.style = this.$route.query.data.style
this.imageUrl = baseURL + this.form.imgUrl
this.richtexttype = '2'
this.formdisable = true
......
......@@ -17,27 +17,40 @@
<span v-else>-</span>
</el-form-item>
</el-form>
<div class="footer"><el-button @click="cancel">返回</el-button></div>
<!-- <div class="footer"><el-button @click="cancel">返回</el-button></div>-->
</div>
</div>
</template>
<script>
import { queryannounceDetailById } from '@/api/announcement'
export default {
name: 'Detail',
data() {
return {
// 详情表单数据
detailform: this.$route.query.data
detailform: {}
}
},
created() {
this.dispose()
this.queryannounceDetail()
// this.dispose()
},
methods: {
cancel() {
this.$router.push('/announcements/index')
},
// 查询公告详情
queryannounceDetail() {
const id = this.$route.query.data
queryannounceDetailById(id).then(res => {
// TODO: clear this log
console.log(`res`, res)
this.detailform = res.data
this.dispose()
})
},
// 处理空格大小
dispose() {
this.detailform.details = this.detailform.details.replace(/\<p/gi,
......
......@@ -310,15 +310,15 @@ export default {
},
/** 详情按钮操作 */
handleDetail(row) {
this.detailform = row
this.detailopen = true
this.dispose()
// this.$router.push({
// path: '/announcements/detail',
// query: {
// data: row
// }
// })
// this.detailform = row
// this.detailopen = true
// this.dispose()
this.$router.push({
path: '/announcements/detail',
query: {
data: row.businessId
}
})
},
/** 修改按钮操作 */
handleUpdate(row) {
......
This diff is collapsed.
......@@ -92,7 +92,7 @@
</el-table-column>
<el-table-column label="下单时间" prop="order_time" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.order_time || '-' }}
{{ scope.row.orderTime || '-' }}
</template>
</el-table-column>
<!-- <el-table-column label="退款时间" prop="refund_time" :show-overflow-tooltip="true">-->
......@@ -122,12 +122,34 @@
@click="handleUpdate(scope.row)"
>详情</el-button>
<el-button
v-if="scope.row.status === 2 || scope.row.status === 3 || scope.row.status === 4 || scope.row.status === 5"
v-if="(scope.row.status === 3 && scope.row.refundCount > 2) || (scope.row.status === 5 && scope.row.refundCount > 2) "
v-hasPermi="['sys:dict:edit']"
size="mini"
type="text"
:disabled="refundreimbursementdisable"
@click="refundreimbursement(scope.row)"
>退款补偿</el-button>
<el-button
v-if="scope.row.status === 8"
v-hasPermi="['sys:dict:edit']"
size="mini"
type="text"
@click="paymentconfirmation(scope.row)"
>支付确认</el-button>
<el-button
v-if="scope.row.status === 9 && scope.row.payPrice > 0"
v-hasPermi="['sys:dict:edit']"
size="mini"
type="text"
@click="chargebacks(scope.row)"
>退单</el-button>
<el-button
v-if="scope.row.status === 2 || scope.row.status === 4"
v-hasPermi="['sys:dict:edit']"
size="mini"
type="text"
@click="refund(scope.row)"
>退款</el-button>
>退款确认</el-button>
</template>
</el-table-column>
</el-table>
......@@ -155,7 +177,7 @@
<span>{{ form.type || '-' }}</span>
</el-form-item>
<el-form-item label="下单时间:">
<span>{{ form.order_time || '-' }}</span>
<span>{{ form.orderTime || '-' }}</span>
</el-form-item>
<!-- <el-form-item label="退款时间">-->
<!-- <span>{{ form.refund_time || '-' }}</span>-->
......@@ -177,12 +199,16 @@
</template>
<script>
import {
addType,
updateType,
} from '@/api/system/dict/type'
import Template from '@/views/instance/Template'
import { orderdetail, orderexport, orderlist } from '@/api/order'
import {
manualchargebacks,
orderdetail,
orderexport,
orderlist,
payconfirmation,
refundcompensate,
refundconfirmation
} from '@/api/order'
export default {
name: 'Dict',
......@@ -191,23 +217,8 @@ export default {
return {
value: true,
value1: '',
refundreimbursementdisable: false,
test: '',
options1: [{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}, {
value: '选项3',
label: '蚵仔煎'
}, {
value: '选项4',
label: '龙须面'
}, {
value: '选项5',
label: '北京烤鸭'
}],
optionsDict: [],
// 遮罩层
loading: true,
......@@ -386,28 +397,93 @@ export default {
},
// 退款按钮操作
refund(row) {
const order = this.orderList
// const order = this.orderList
this.$confirm('是否确认退款?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
order.forEach(item => {
if (row.id === item.id) {
if (row.status === 2 || row.status === 3) {
item.status = 6
} else if (row.status === 4 || row.status === 5) {
item.status = 7
}
}
const query = {
transactionId: row.transactionId,
businessId: row.businessId,
goodsId: row.goodsId
}
refundconfirmation(query).then(res => {
// TODO: clear this log
console.log(`退款确认`, res)
})
// console.log('order', order)
}).then(() => {
// 把订单数据重新赋值
this.orderList = order
// this.orderList = order
this.getList()
this.$forceUpdate()
// console.log('退款', this.orderList)
})
},
// 退款补偿
refundreimbursement(val) {
// const order = this.orderList
this.$confirm('是否确认退款?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const ids = {
ids: val.businessId
}
refundcompensate(ids).then(res => {
// TODO: clear this log
console.log(`退款补偿`, res)
if (res.code === 200) {
setTimeout(function() {
this.getList()
}, 3000)
}
})
})
},
// 支付确认
paymentconfirmation(row) {
this.$confirm('是否确认该订单已支付?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
const query = {
businessId: row.businessId,
goodsId: row.goodsId
}
payconfirmation(query).then(res => {
// TODO: clear this log
console.log(`支付确认`, res)
})
}).then(() => {
// 把订单数据重新赋值
this.getList()
// console.log('退款', this.orderList)
})
},
// 人工退单
chargebacks(row) {
this.$confirm('是否确认退单?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
const query = {
businessId: row.businessId,
goodsId: row.goodsId,
manualRefund: 1
}
manualchargebacks(query).then(res => {
// TODO: clear this log
console.log(`人工退单`, res)
})
}).then(() => {
// 把订单数据重新赋值
this.getList()
// console.log('退款', this.orderList)
})
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment