Commit e3b41f3c authored by 黄卓's avatar 黄卓

品牌添加授权,已授权列表

parent 88391394
......@@ -5,7 +5,12 @@
const baseURL = process.env.VUE_APP_BASE_API
// 日期格式化
/**
* 日期格式化
* @param time {String|Number|Date} 时间
* @param pattern {String} '{y}-{m}-{d} {h}:{i}:{s}'
* @returns {string|null}
*/
export function parseTime(time, pattern) {
if (arguments.length === 0 || !time) {
return null
......
......@@ -52,11 +52,37 @@
prop="phone"
label="客户号码">
</el-table-column>
<el-table-column
prop="fileUrl"
label="授权证明">
<template v-slot="{row}">
<div v-if="!!row.fileUrl && row.fileUrl.length > 0">
<span v-for="(item, index) in row.fileUrl.split(',')">
<a :href="item" target="_blank">附件{{ index + 1 }}</a>,
</span>
</div>
</template>
</el-table-column>
<el-table-column
prop="startTime"
width="200px"
:formatter="(row) => parseTime(row.startTime, '{y}-{m}-{d}') + ' - ' + parseTime(row.endTime, '{y}-{m}-{d}')"
label="授权时间">
</el-table-column>
<el-table-column
prop="feeScale"
:formatter="(row) => getDictDataLabel(DICT_TYPE.BRAND_CUSTOMER_CHARGING_MODEL, row.feeScale)"
label="收费标准">
</el-table-column>
<el-table-column
prop="createUsername"
label="添加人">
</el-table-column>
<el-table-column
width="100px"
label="操作">
<template v-slot="{row}">
<el-button type="primary" size="mini" @click="handleDelete(row.id)">删除</el-button>
<el-button type="danger" size="mini" @click="handleDelete(row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
......@@ -108,8 +134,9 @@ import {
getProductBrandEmpowerPageUnauth
} from "@/api/ecw/productBrandEmpower"
import DictSelector from "@/components/DictSelector"
import {DICT_TYPE} from "@/utils/dict"
import { DICT_TYPE, getDictDataLabel } from '@/utils/dict'
import FileUpload from '@/components/FileUpload'
import { parseTime } from '@/utils/ruoyi'
export default {
name: "Empower",
......@@ -131,6 +158,8 @@ export default {
data() {
return {
DICT_TYPE,
getDictDataLabel,
parseTime,
dialogVisible: false,
activeName: 'first',
total1: 0,
......@@ -192,9 +221,25 @@ export default {
this.addDialog.dialogVisible = true
},
handleDelete(id) {
deleteProductBrandEmpower(id).then(r => {
this.getList2()
})
this.$confirm('确认删除该用户的授权?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteProductBrandEmpower(id).then(r => {
this.getList1()
this.getList2()
this.$message({
type: 'success',
message: '撤销授权成功!'
});
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
getList1(){
getProductBrandEmpowerPageUnauth({...this.list1QueryParams, productBrandId: this.id}).then(r => {
......
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