Commit e3b41f3c authored by 黄卓's avatar 黄卓

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

parent 88391394
...@@ -5,7 +5,12 @@ ...@@ -5,7 +5,12 @@
const baseURL = process.env.VUE_APP_BASE_API 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) { export function parseTime(time, pattern) {
if (arguments.length === 0 || !time) { if (arguments.length === 0 || !time) {
return null return null
......
...@@ -52,11 +52,37 @@ ...@@ -52,11 +52,37 @@
prop="phone" prop="phone"
label="客户号码"> label="客户号码">
</el-table-column> </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 <el-table-column
width="100px" width="100px"
label="操作"> label="操作">
<template v-slot="{row}"> <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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -108,8 +134,9 @@ import { ...@@ -108,8 +134,9 @@ import {
getProductBrandEmpowerPageUnauth getProductBrandEmpowerPageUnauth
} from "@/api/ecw/productBrandEmpower" } from "@/api/ecw/productBrandEmpower"
import DictSelector from "@/components/DictSelector" import DictSelector from "@/components/DictSelector"
import {DICT_TYPE} from "@/utils/dict" import { DICT_TYPE, getDictDataLabel } from '@/utils/dict'
import FileUpload from '@/components/FileUpload' import FileUpload from '@/components/FileUpload'
import { parseTime } from '@/utils/ruoyi'
export default { export default {
name: "Empower", name: "Empower",
...@@ -131,6 +158,8 @@ export default { ...@@ -131,6 +158,8 @@ export default {
data() { data() {
return { return {
DICT_TYPE, DICT_TYPE,
getDictDataLabel,
parseTime,
dialogVisible: false, dialogVisible: false,
activeName: 'first', activeName: 'first',
total1: 0, total1: 0,
...@@ -192,9 +221,25 @@ export default { ...@@ -192,9 +221,25 @@ export default {
this.addDialog.dialogVisible = true this.addDialog.dialogVisible = true
}, },
handleDelete(id) { handleDelete(id) {
this.$confirm('确认删除该用户的授权?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteProductBrandEmpower(id).then(r => { deleteProductBrandEmpower(id).then(r => {
this.getList1()
this.getList2() this.getList2()
this.$message({
type: 'success',
message: '撤销授权成功!'
});
}) })
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}, },
getList1(){ getList1(){
getProductBrandEmpowerPageUnauth({...this.list1QueryParams, productBrandId: this.id}).then(r => { 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