master
parent
8239264290
commit
490ed3e31d
@ -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>
|
||||
Loading…
Reference in new issue