<template>
|
<div>
|
<list-condition-template ref="table" :tableData="tableData" :isShowPage="false" @page-info-change="handlePageInfoChange">
|
<template slot="operationSection">
|
<el-button size="mini" type="success" @click="addItem">新增审核渠道</el-button>
|
</template>
|
<template slot="columns">
|
<el-table-column label="审核渠道">
|
<template slot-scope="scope">
|
{{getLabel(orderSourceArr,scope.row.orderSource)}}
|
</template>
|
</el-table-column>
|
<el-table-column label="是否开启订单审核" width="160">
|
<template slot-scope="scope">
|
{{scope.row.configParams.orderReview ==="1" ?'是': '否' }}
|
</template>
|
</el-table-column>
|
<el-table-column label="审核类型/推送类型" width="180">
|
<template slot-scope="scope">
|
<span v-if="scope.row.configParams.orderReview === '1'">{{scope.row.configParams.otherOrderControReview ==="0" ?'审核所有订单': '审核符合条件订单' }}</span>
|
<span v-else>{{scope.row.configParams.delayPushTime ? '定时推送' : '实时推送'}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="未发货订单自动退款" width="180">
|
<template slot-scope="scope">
|
<span v-if="scope.row.orderSource.includes('WLY')">
|
{{scope.row.configParams.deliveryRefundReview ==="0" ?'是': '否' }}
|
</span>
|
<span v-else>-</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="修改人" prop="updatorName" width="120">
|
</el-table-column>
|
<el-table-column label="修改时间" prop="updateTime" width="180">
|
</el-table-column>
|
<el-table-column label="操作" :width="`${2 * $store.getters.colSize}px`">
|
<template slot-scope="scope">
|
<wly-btn type="primary" @click="editInfo(scope.row)">编辑</wly-btn>
|
<wly-btn type="danger" @click="deleteItem(scope.row)" >删除</wly-btn>
|
</template>
|
</el-table-column>
|
</template>
|
</list-condition-template>
|
</div>
|
</template>
|
<script>
|
import orderAuditConfigApi from '@/api/orderAuditConfig'
|
import { getArrayLable } from '@/utils/getArrayLable'
|
import orderSourceArr from '@/utils/constant/orderSourceArr'
|
|
export default {
|
data () {
|
return {
|
tableData: [],
|
orderSourceArr
|
}
|
},
|
/*
|
* 数据变化后刷新列表
|
*/
|
activated () {
|
this.queryList(this.$refs.table.getPageInfo())
|
},
|
methods: {
|
/**
|
* 获取数组的label
|
*/
|
getLabel (array, id) {
|
let str = ''
|
id.split(',').forEach((item, index, arr) => {
|
const endTag = arr.length !== index + 1 ? ',' : ''
|
str += getArrayLable(array, item) + endTag
|
})
|
return str
|
},
|
// 删除
|
deleteItem (row) {
|
this.$confirm('删除后该审核策略将不在生效,确认要删除吗', '删除', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(async () => {
|
try {
|
const res = await orderAuditConfigApi.deleteItem({ id: row.id })
|
if (res.code === '0') {
|
this.$message({
|
message: '删除成功',
|
type: 'success'
|
})
|
this.$refs.table.changeCondition() // 查询列表
|
}
|
} catch (error) {
|
}
|
})
|
},
|
/**
|
* '分页信息改变时查询列表
|
*/
|
handlePageInfoChange (pageInfo) {
|
this.queryList(pageInfo)
|
},
|
/**
|
* 点击查询按钮
|
*/
|
queryData () {
|
this.$refs.table.changeCondition()
|
},
|
/**
|
* 编辑
|
*/
|
editInfo (row) {
|
this.$router.push({
|
name: 'auditConfigEdit',
|
query: { id: row.id }
|
})
|
},
|
/**
|
* 查询列表
|
*/
|
queryList () {
|
orderAuditConfigApi.getList().then(res => {
|
this.tableData = res.data
|
})
|
},
|
/**
|
* 跳转到新增页面
|
*/
|
addItem () {
|
this.$router.push({ name: 'auditConfigAdd' })
|
}
|
}
|
}
|
</script>
|