xy 3 years ago
parent 8239264290
commit 490ed3e31d

@ -15,3 +15,11 @@ export function itemAction(params){
params
})
}
export function log(params){
return request({
method:'get',
url:'/api/merchant/order/get-item-logs',
params
})
}

@ -26,7 +26,9 @@
</div>
<xy-table :table-item="table" :list="data">
<xy-table :table-item="table" :list="data" :total="total"
@pageSizeChange="e => {select.rows = e;select.page = 1;getList()}"
@pageIndexChange="e => {select.page = e;getList()}">
<template v-slot:btns><div></div></template>
</xy-table>
</div>
@ -46,10 +48,52 @@ export default {
page:1,
rows:10,
},
total:0,
balance:{},
data:[],
table:[
{
label:'产生时间',
prop:'created_at_formatted',
width: 200,
sortable:false
},
{
label:'金额',
align:'right',
prop:'money',
width: 160,
sortable:false
},
{
label:'余额',
prop:'balance',
align:'right',
width: 160,
sortable:false
},
{
label:'类型',
prop:'type_name',
width: 160,
sortable: false
},
{
label:'相关类型',
prop:'related_type_name',
width: 160,
sortable: false
},
{
label:'相关流水号',
prop:'related_id',
sortable:false
},
{
label:'相关子订单号',
prop:'order_item_id',
sortable: false
}
]
}
},
@ -64,6 +108,7 @@ export default {
let res = await getList(this.select)
console.log(res)
this.data = res.data
this.total = res.total
}
},
computed: {

@ -0,0 +1,107 @@
<template>
<div>
<xy-dialog :width="32" :title="titleFormat" :form="form" :is-show.sync="isShow" type="form" :rules="rule" @submit="submit">
<template v-slot:remark>
<div class="xy-table-item">
<div class="xy-table-item-label">
<template v-if="form.action == 'follow_by_merchant' || form.action == 'return_by_merchant' || form.action == 'mark_cancel_by_merchant'">
<span style="color: red;font-weight: 600;padding-right: 4px;" >*</span>
</template>
备注
</div>
<div class="xy-table-item-content">
<el-input v-model="form.remark" type="textarea" :autosize="{minRows:2}" style="width: 200px;"></el-input>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {itemAction} from '@/api/order'
export default {
props:{
},
data() {
let validateRemark = (rule, value, callback) => {
if(this.form.action == 'follow_by_merchant'){
if(!value){
callback(new Error('未提交任何跟进内容!'))
return
}
callback()
return
}
if(this.form.action == 'return_by_merchant'){
if(!value){
callback(new Error('未提交退回原因!'))
return
}
callback()
return
}
if(this.form.action == 'mark_cancel_by_merchant'){
if(!value){
callback(new Error('未输入用户拒绝原因!'))
return
}
callback()
return
}
callback()
}
return {
isShow:false,
form:{
item_id:'',
action:'',
remark:''
},
rule:{
remark:[
{ validator: validateRemark, trigger: 'blur' }
]
}
}
},
methods: {
submit(){
itemAction(this.form).then(res => {
console.log(res)
this.$message({
type:'success',
message:'操作成功'
})
this.isShow = false
this.$emit('refresh')
})
}
},
computed: {
titleFormat(){
switch (this.form.action){
case 'follow_by_merchant':
return '请输入跟进内容';
case 'accept_by_merchant':
return '确认接收时可能将从商户余额中扣除一定比例的平台佣金';
case 'return_by_merchant':
return '主动退回视作为拒绝此次平台发单,请输入退回原因';
case 'confirm_by_merchant':
return '确认有效可能将从商户余额中扣除一定比例的平台佣金';
case 'finish_by_merchant':
return '确认核销吗';
case 'mark_cancel_by_merchant':
return '请输入用户拒绝原因';
default :
return '操作'
}
}
}
}
</script>
<style scoped lang="scss">
</style>

@ -18,28 +18,76 @@
</div>
<xy-table :table-item="table" :list="data">
<xy-table
:table-item="table"
:list="data"
:total="total"
@pageSizeChange="e => {select.rows = e;select.page = 1;getList()}"
@pageIndexChange="e => {select.page = e;getList()}">
<template v-slot:btns><div></div></template>
</xy-table>
<operate ref="operate" @refresh="getList"></operate>
<el-drawer
size="38%"
title="日志"
:visible.sync="isShowDraw"
direction="rtl">
<xy-table style="margin: 20px 0" :is-page="false" :list="logs" :table-item="logTable">
<template v-slot:btns><div></div></template>
</xy-table>
</el-drawer>
</div>
</template>
<script>
import operate from '@/views/order/component/operate.vue'
import LxHeader from '@/components/LxHeader/index.vue'
import {getList} from '@/api/order'
import {getList,log} from '@/api/order'
export default {
components: {
LxHeader
LxHeader,
operate
},
data() {
return {
isShowDraw:false,
isShowOperate:false,
select:{
page:1,
rows:10,
show_history:0
},
total:0,
data:[],
logs:[],
logTable:[
{
label:'操作类型',
prop:'operate_name',
width:120,
sortable: false
},
{
label:'操作人',
prop:'operator.username',
width: 140,
sortable: false
},
{
label:'操作时间',
prop:'created_at',
width: 200,
sortable: false
},
{
label:'备注',
prop:'remark',
sortable: false
}
],
table:[
{
label:'客户姓名',
@ -76,6 +124,7 @@ export default {
sortable:false,
align:'left',
customFn:row => {
const _this = this
let map = new Map([
['follow_by_merchant','el-icon-s-comment'],
['accept_by_merchant','el-icon-s-promotion'],
@ -88,11 +137,63 @@ export default {
if(typeof row?.merchant_actions == 'object'){
for(let key in row.merchant_actions){
btns.push(
<el-button size="mini" type="primary" icon={map.get(key)} plain>{row.merchant_actions[key]}</el-button>
<el-button
size="mini"
type="primary"
icon={map.get(key)}
plain
style={
{
'margin':'0 6px 4px 0'
}
}
on={
{
['click']:e => {
_this.$refs['operate'].form.item_id = row.id
_this.$refs['operate'].form.action = key
_this.$refs['operate'].isShow = true
console.log(key)
}
}
}>{row.merchant_actions[key]}</el-button>
)
}
}
return btns
btns.push(
<el-button
size="mini"
type="primary"
icon="el-icon-document-copy"
plain
style={
{
'margin':'0 6px 4px 0'
}
}
on={
{
['click']:e => {
log({
item_id:row.id
}).then(res => {
this.logs = res.data
})
this.isShowDraw = true
}
}
}>日志</el-button>
)
return (
<div style={
{
'display':'flex',
'flex-wrap':'wrap'
}
}>
{ btns }
</div>
)
}
}
]
@ -103,6 +204,7 @@ export default {
let res = await getList(this.select)
console.log(res)
this.data = res.data
this.total = res.total
}
},
computed: {},
@ -113,4 +215,7 @@ export default {
</script>
<style scoped lang="scss">
//::v-deep .el-button + .el-button{
// margin-left: 0 !important;
//}
</style>

Loading…
Cancel
Save