|
|
@@ -0,0 +1,558 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<crud-template :ref="(el) => (crudRef = el)" class="as-weight" :home-data="field" :table-data="tableData" |
|
|
|
@btnSearch="btnSearch" @add="add" @handleEdit="handleEdit" @handleDelete="handleDelete" @cancel="cancel" |
|
|
|
@submit="submit" @refreshLeft="refreshLeft" @download="downloadHandle" @CurrentChange="handleCurrentChange" |
|
|
|
@pageSizeChange="(val) => { |
|
|
|
field.paging.currentPage = 1 |
|
|
|
field.paging.pageSize = val |
|
|
|
getList() |
|
|
|
} |
|
|
|
"> |
|
|
|
<template #search> |
|
|
|
<el-input maxlength="60" v-trim clearable v-model="searchForm.agencyId" style="width: 200px" |
|
|
|
placeholder="请输入接入渠道编号" /> |
|
|
|
<el-input maxlength="60" v-trim clearable v-model="searchForm.noticeUrl" style="width: 200px" |
|
|
|
placeholder="请输入服务地址" /> |
|
|
|
<el-select clearable v-model="searchForm.status" placeholder="请选择状态" style="width: 150px"> |
|
|
|
<el-option :label="item.label" :key="item.label" :value="item.value" v-for="item in statusType" /> |
|
|
|
</el-select> |
|
|
|
<el-date-picker unlink-panels v-model="value1" type="datetimerange" range-separator="到" start-placeholder="开始日期" |
|
|
|
end-placeholder="结束日期" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss" |
|
|
|
@change="dateChangeHandle" :clearable="false" /> |
|
|
|
</template> |
|
|
|
<template #status="item"> |
|
|
|
<!-- @vue-ignore --> |
|
|
|
<el-switch :disabled="!IsPermission(route, 'STAET_LIST')" v-model="item.scope.row.status" :active-value="0" |
|
|
|
:inactive-value="1" active-color="#13ce66" inactive-color="#ff4949" |
|
|
|
@click="handleBeforeChange(item.scope.row.status, item.scope.row)"></el-switch> |
|
|
|
</template> |
|
|
|
<template #operation="{ scope }"> |
|
|
|
<el-button v-if="scope.row.status === 'DISABLE' && IsPermission(route, 'STAET_LIST')" type="primary" |
|
|
|
@click="handleDelete(scope.row, 'ENABLE')" size="small">启用</el-button> |
|
|
|
<el-button v-if="scope.row.status === 'ENABLE' && IsPermission(route, 'STAET_LIST')" type="danger" |
|
|
|
@click="handleDelete(scope.row, 'DISABLE')" size="small">停用</el-button> |
|
|
|
</template> |
|
|
|
</crud-template> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<!-- 接入渠道查询 --> |
|
|
|
<script lang="ts" setup> |
|
|
|
// @ts-ignore crudFrom模板 |
|
|
|
import CrudTemplate from '@/crud/index.vue' |
|
|
|
import { ref, onMounted, computed, reactive, toRaw } from 'vue' |
|
|
|
import { ElMessage } from 'element-plus' |
|
|
|
import BaseService from '@/utils/baseService' |
|
|
|
import moment from 'moment' |
|
|
|
import $storeinitData from '@/store/initData' //引入tab vuex |
|
|
|
import { IsPermission } from '@/router/routerUtil' |
|
|
|
import { useRoute } from 'vue-router' |
|
|
|
import $storeInitData from '@/store/initData' |
|
|
|
const route = useRoute() |
|
|
|
const agencyIdList = ref([]) |
|
|
|
|
|
|
|
const VEHICLE_COLOR_TYPE = computed(() => { |
|
|
|
return $storeinitData.state.dictData['VEHICLE_COLOR_TYPE'] || [] |
|
|
|
}) |
|
|
|
const statusType = [{ |
|
|
|
label: '启用', |
|
|
|
value: 'ENABLE' |
|
|
|
}, { |
|
|
|
label: '禁用', |
|
|
|
value: 'DISABLE' |
|
|
|
}] |
|
|
|
|
|
|
|
const crudRef = ref() |
|
|
|
const searchForm = ref({ |
|
|
|
agencyId: '', |
|
|
|
noticeUrl: '', |
|
|
|
status: '', |
|
|
|
startTime: '', |
|
|
|
endTime: '', |
|
|
|
}) |
|
|
|
const value1 = ref() // 筛选时间 |
|
|
|
const tableData = ref([]) |
|
|
|
|
|
|
|
function getAgenCy() { |
|
|
|
BaseService.post('/userw/agency/agencyqueryall', {}).then((res: any) => { |
|
|
|
if (res && res.statusCode === 0) { |
|
|
|
//数据转换 .agencyQueryAllModels |
|
|
|
let bizContent = res.data |
|
|
|
agencyIdList.value = bizContent.map((item) => { |
|
|
|
return { label: item.name, value: item.agencyId } |
|
|
|
}) |
|
|
|
// console.log(agencyIdList.value, 'agencyIdList.value') |
|
|
|
} else { |
|
|
|
ElMessage.error(res.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
//表单数据配置 |
|
|
|
const formLabelWidth = '180px' |
|
|
|
const field = ref({ |
|
|
|
tabSize: 'small', //Table 的尺寸 large / default /small (默认default) |
|
|
|
searchShow: IsPermission(route, 'QUERY_BASE'), //是否显示搜索模块(默认false) |
|
|
|
border: true, //是否添加边框(默认false) |
|
|
|
dialogCustom: false, //自定义Dialog (默认false) |
|
|
|
dialogFooter: false, //隐藏弹窗页脚显示 (默认false) |
|
|
|
dialogWidth: '40%', //dialog宽度 (默认40%) |
|
|
|
crudShow: false, //是否显示CURD操作栏 (默认true) |
|
|
|
crudChildShow: false, //是否显示CURD子操作栏 (默认true) |
|
|
|
paginStart: true, //是否显示分页查询 (默认false) |
|
|
|
isPageSizes: true, |
|
|
|
pageLayout: 'total, sizes, prev, pager, next', |
|
|
|
titleDialog: '', //table 标题 |
|
|
|
paging: { |
|
|
|
pageSize: 10, |
|
|
|
currentPage: 1, |
|
|
|
total: 0, |
|
|
|
}, |
|
|
|
crud: { |
|
|
|
add: IsPermission(route, 'ADD_BASE'), |
|
|
|
}, |
|
|
|
searchOperation: { |
|
|
|
isDownload: false, // 导出 |
|
|
|
isToLead: false, // 导入 |
|
|
|
isAdd: IsPermission(route, 'ADD_BASE'), |
|
|
|
isTransferMachine: false, |
|
|
|
}, |
|
|
|
tableSize: -1, |
|
|
|
operateShow: true, //是否为表格添加操作栏(默认true) |
|
|
|
operateTitle: '操作', //操作栏标题(默认为"") |
|
|
|
operateFixed: true, //操作栏是否固定(默认false) |
|
|
|
operateWidth: '200', //操作栏宽度 |
|
|
|
operate: { |
|
|
|
info: IsPermission(route, 'INFO_LIST'), //详情 |
|
|
|
edit: IsPermission(route, 'EDIT_LIST'), //是否编辑(默认true) |
|
|
|
delete: false, //是否删除(默认true) |
|
|
|
remark: false, // 查看 |
|
|
|
}, |
|
|
|
extend: [ |
|
|
|
{ |
|
|
|
type: 'index', |
|
|
|
label: '序号', |
|
|
|
}, |
|
|
|
], |
|
|
|
field: [ |
|
|
|
{ |
|
|
|
label: '渠道编号', |
|
|
|
prop: 'agencyId', |
|
|
|
form: { |
|
|
|
disabled: false, |
|
|
|
hideEdit: true, |
|
|
|
formLabelWidth: formLabelWidth, |
|
|
|
type: 'input', |
|
|
|
listDate:"", |
|
|
|
required: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
prop: "agencyId", |
|
|
|
label: "渠道名称", |
|
|
|
funRuleStarts: true, //是否启用转换规则 |
|
|
|
funRule: (value) => { |
|
|
|
//自定义转换规则 |
|
|
|
return value; |
|
|
|
}, |
|
|
|
form: { |
|
|
|
formLabelWidth: formLabelWidth, |
|
|
|
width: '90%', |
|
|
|
type: 'select', |
|
|
|
required: true, |
|
|
|
disabled: false, |
|
|
|
listData: agencyIdList |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '发行回调接口地址', |
|
|
|
prop: 'noticeUrl', |
|
|
|
form: { |
|
|
|
disabled: false, |
|
|
|
formLabelWidth: formLabelWidth, |
|
|
|
width: '90%', |
|
|
|
type: 'input', |
|
|
|
required: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '支持设备更换', |
|
|
|
prop: 'deviceChange', |
|
|
|
form: { |
|
|
|
listData: [ |
|
|
|
{ value: true, label: '是' }, |
|
|
|
{ value: false, label: '否' }, |
|
|
|
], |
|
|
|
formLabelWidth: formLabelWidth, |
|
|
|
width: '90%', |
|
|
|
type: 'select', |
|
|
|
required: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '不支持设备更换后处理方式', |
|
|
|
prop: 'dealType', |
|
|
|
hide: true, |
|
|
|
form: { |
|
|
|
listData: [ |
|
|
|
{ value: "1", label: '新办' }, |
|
|
|
{ value: "2", label: '提示用户' }, |
|
|
|
], |
|
|
|
formLabelWidth: formLabelWidth, |
|
|
|
width: '90%', |
|
|
|
type: 'select', |
|
|
|
required: false, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '提示', |
|
|
|
prop: 'deviceChangeNotice', |
|
|
|
hide: true, |
|
|
|
form: { |
|
|
|
formLabelWidth: formLabelWidth, |
|
|
|
width: '90%', |
|
|
|
type: 'input', |
|
|
|
required: false, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '支持车牌变更', |
|
|
|
prop: 'vehicleChange', |
|
|
|
form: { |
|
|
|
listData: [ |
|
|
|
{ value: true, label: '是' }, |
|
|
|
{ value: false, label: '否' }, |
|
|
|
], |
|
|
|
formLabelWidth: formLabelWidth, |
|
|
|
width: '90%', |
|
|
|
type: 'select', |
|
|
|
integerlength: 10, |
|
|
|
required: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '支持设备注销', |
|
|
|
prop: 'deviceCancel', |
|
|
|
form: { |
|
|
|
listData: [ |
|
|
|
{ value: true, label: '是' }, |
|
|
|
{ value: false, label: '否' }, |
|
|
|
], |
|
|
|
formLabelWidth: formLabelWidth, |
|
|
|
width: '90%', |
|
|
|
type: 'select', |
|
|
|
integerlength: 10, |
|
|
|
required: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '支持签约代扣信息变更', |
|
|
|
prop: 'signChange', |
|
|
|
form: { |
|
|
|
listData: [ |
|
|
|
{ value: true, label: '是' }, |
|
|
|
{ value: false, label: '否' }, |
|
|
|
], |
|
|
|
formLabelWidth: formLabelWidth, |
|
|
|
width: '90%', |
|
|
|
type: 'select', |
|
|
|
integerlength: 10, |
|
|
|
required: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '是否黔通代扣签约', |
|
|
|
prop: 'qtSign', |
|
|
|
form: { |
|
|
|
listData: [ |
|
|
|
{ value: true, label: '是' }, |
|
|
|
{ value: false, label: '否' }, |
|
|
|
], |
|
|
|
formLabelWidth: formLabelWidth, |
|
|
|
width: '90%', |
|
|
|
type: 'select', |
|
|
|
integerlength: 10, |
|
|
|
required: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '渠道签约地址', |
|
|
|
prop: 'channelSignUrl', |
|
|
|
form: { |
|
|
|
formLabelWidth: formLabelWidth, |
|
|
|
width: '90%', |
|
|
|
type: 'input', |
|
|
|
integerlength: 10, |
|
|
|
required: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '渠道签约小程序id', |
|
|
|
prop: 'channelSignAppId', |
|
|
|
form: { |
|
|
|
formLabelWidth: formLabelWidth, |
|
|
|
width: '90%', |
|
|
|
type: 'input', |
|
|
|
integerlength: 10, |
|
|
|
required: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '是否黔通产品签约', |
|
|
|
prop: 'qtUserSign', |
|
|
|
form: { |
|
|
|
listData: [ |
|
|
|
{ value: true, label: '是' }, |
|
|
|
{ value: false, label: '否' }, |
|
|
|
], |
|
|
|
formLabelWidth: formLabelWidth, |
|
|
|
width: '90%', |
|
|
|
type: 'select', |
|
|
|
integerlength: 10, |
|
|
|
required: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '状态', |
|
|
|
prop: 'status', |
|
|
|
form: { |
|
|
|
listData: [ |
|
|
|
{ value: "ENABLE", label: '启用' }, |
|
|
|
{ value: "DISABLE", label: '停用' }, |
|
|
|
], |
|
|
|
hideEdit: true, |
|
|
|
formLabelWidth: formLabelWidth, |
|
|
|
width: '90%', |
|
|
|
type: 'select', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '创建时间', |
|
|
|
prop: 'createTime', |
|
|
|
funRuleStarts: true, |
|
|
|
funRule: (time: any) => { |
|
|
|
return time ? time.replace('T', ' ') : '' |
|
|
|
}, |
|
|
|
form: { |
|
|
|
funRuleStarts: true, |
|
|
|
funRule: (time: any) => { |
|
|
|
return time ? time.replace('T', ' ') : '-'; |
|
|
|
}, |
|
|
|
hideEdit: true, |
|
|
|
formLabelWidth: formLabelWidth, |
|
|
|
width: '90%', |
|
|
|
type: 'input', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '更新时间', |
|
|
|
prop: 'updateTime', |
|
|
|
funRuleStarts: true, |
|
|
|
funRule: (time: any) => { |
|
|
|
return time ? time.replace('T', ' ') : '' |
|
|
|
}, |
|
|
|
form: { |
|
|
|
funRuleStarts: true, |
|
|
|
funRule: (time: any) => { |
|
|
|
return time ? time.replace('T', ' ') : '-'; |
|
|
|
}, |
|
|
|
hideEdit: true, |
|
|
|
formLabelWidth: formLabelWidth, |
|
|
|
width: '90%', |
|
|
|
type: 'input', |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
}) |
|
|
|
const typeOption = ref('') |
|
|
|
// 编辑按钮 |
|
|
|
function handleEdit(idx: any, row: any) { |
|
|
|
changeStatus(true) |
|
|
|
typeOption.value = 'edit'; |
|
|
|
getAgenCy(); |
|
|
|
} |
|
|
|
function changeStatus(b) { |
|
|
|
field.value.field.forEach((item: any) => { |
|
|
|
if ( |
|
|
|
item.prop == 'accessChannelCode' |
|
|
|
) { |
|
|
|
item.form.disabled = b |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
// 新增按钮 |
|
|
|
function add() { |
|
|
|
changeStatus(false) |
|
|
|
typeOption.value = "add"; |
|
|
|
getAgenCy(); |
|
|
|
} |
|
|
|
// 提交 |
|
|
|
function submit(data: any) { |
|
|
|
if (typeOption.value === 'edit') { |
|
|
|
// 编辑 |
|
|
|
data.add = false |
|
|
|
data.updator = $storeInitData.getters.userName |
|
|
|
let datas = JSON.parse(JSON.stringify(toRaw(data))) |
|
|
|
// console.log(data, 'datadata') |
|
|
|
BaseService.post('/userw/agency/config/update', datas).then((res: any) => { |
|
|
|
if (res && res.statusCode === 0) { |
|
|
|
ElMessage.success('操作成功') |
|
|
|
getList() |
|
|
|
cancel() |
|
|
|
} else { |
|
|
|
ElMessage.error(res.errorMsg) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
// 新增 |
|
|
|
data.add = true |
|
|
|
data.creator = $storeInitData.getters.userName |
|
|
|
let datas = JSON.parse(JSON.stringify(toRaw(data))) |
|
|
|
// console.log(data, 'datadata') |
|
|
|
BaseService.post('/userw/agency/config/add', datas).then((res: any) => { |
|
|
|
if (res && res.statusCode === 0) { |
|
|
|
ElMessage.success('操作成功') |
|
|
|
getList() |
|
|
|
cancel() |
|
|
|
} else { |
|
|
|
ElMessage.error(res.errorMsg) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//切换按钮 INAPPLICATION 启用 DISABLE 停用 |
|
|
|
function handleBeforeChange(value, arg1) { |
|
|
|
// console.log(arg1, 'arg1arg1') |
|
|
|
BaseService.post('/userw/agency/config/delete', arg1).then( |
|
|
|
(res: any) => { |
|
|
|
if (res && res.statusCode === "ENABLE") { |
|
|
|
if (value == 'ENABLE') { |
|
|
|
ElMessage.success('启用成功') |
|
|
|
} else { |
|
|
|
ElMessage.error('禁用成功') |
|
|
|
} |
|
|
|
} else { |
|
|
|
ElMessage.error(res.errorMsg) |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
} |
|
|
|
// 删除按钮 |
|
|
|
function handleDelete(idx: any, row: any) { |
|
|
|
const data = toRaw(row) |
|
|
|
BaseService.post('/userw/agency/config/delete', { id: idx.id, status: row}).then( |
|
|
|
(res: any) => { |
|
|
|
if (res && res.statusCode === 0) { |
|
|
|
ElMessage.success('操作成功') |
|
|
|
getList() |
|
|
|
cancel() |
|
|
|
} else { |
|
|
|
ElMessage.error(res.errorMsg) |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
} |
|
|
|
// 取消 |
|
|
|
function cancel() { |
|
|
|
crudRef.value.reset() |
|
|
|
crudRef.value.dialogFormVisible = false |
|
|
|
} |
|
|
|
// 搜索按钮 |
|
|
|
function btnSearch() { |
|
|
|
field.value.paging.currentPage = 1 |
|
|
|
getList() |
|
|
|
} |
|
|
|
// 搜索重置 |
|
|
|
function refreshLeft() { |
|
|
|
field.value.paging.currentPage = 1 |
|
|
|
searchForm.value = { |
|
|
|
agencyId: '', |
|
|
|
noticeUrl: '', |
|
|
|
status: '', |
|
|
|
startTime: '', |
|
|
|
endTime: '', |
|
|
|
} |
|
|
|
value1.value = null |
|
|
|
tableData.value = [] |
|
|
|
getList() |
|
|
|
} |
|
|
|
function dateChangeHandle(val) { |
|
|
|
if (val) { |
|
|
|
searchForm.value.startTime = val[0]; |
|
|
|
searchForm.value.endTime = val[1] |
|
|
|
} else { |
|
|
|
searchForm.value.startTime = ""; |
|
|
|
searchForm.value.endTime = "" |
|
|
|
} |
|
|
|
} |
|
|
|
// 处理请求参数 |
|
|
|
const handleParams = (isPage?) => { |
|
|
|
let params: any = {} |
|
|
|
if (!isPage) { |
|
|
|
params.pageNo = field.value.paging.currentPage |
|
|
|
params.pageSize = field.value.paging.pageSize |
|
|
|
} |
|
|
|
for (const key in searchForm.value) { |
|
|
|
let data = searchForm.value[key] |
|
|
|
if (data || data === 0) { |
|
|
|
params[key] = data |
|
|
|
} |
|
|
|
} |
|
|
|
return params |
|
|
|
} |
|
|
|
const isDetailShow = ref(false) |
|
|
|
const selectedData = ref<any>({}) |
|
|
|
const isEditShow = ref(false) |
|
|
|
const handleData = (scope, key) => { |
|
|
|
// console.log(scope) |
|
|
|
if (key == 'detail') { |
|
|
|
isDetailShow.value = true |
|
|
|
} else { |
|
|
|
isEditShow.value = true |
|
|
|
} |
|
|
|
selectedData.value = scope.row |
|
|
|
} |
|
|
|
// 获取列表 |
|
|
|
function getList() { |
|
|
|
if(!IsPermission(route, 'QUERY_BASE')){ |
|
|
|
ElMessage.error('您没有权限,请联系管理员!') |
|
|
|
return |
|
|
|
} |
|
|
|
crudRef.value.tableLoding = true |
|
|
|
const params = handleParams() |
|
|
|
// console.log(params, 'paramsparams') |
|
|
|
BaseService.postN('/userw/agency/config/page', params).then( |
|
|
|
(res: any) => { |
|
|
|
if (res && res.statusCode === 0) { |
|
|
|
let bizContent = res.data |
|
|
|
let data = bizContent.result || []; |
|
|
|
tableData.value = data |
|
|
|
// console.log(bizContent) |
|
|
|
crudRef.value.tableLoding = false |
|
|
|
field.value.paging.total = bizContent.totalCount |
|
|
|
} else { |
|
|
|
crudRef.value.tableLoding = false |
|
|
|
ElMessage.error(res.errorMsg) |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
} |
|
|
|
function handleCurrentChange(val: number) { |
|
|
|
field.value.paging.currentPage = val |
|
|
|
getList() |
|
|
|
} |
|
|
|
import { optionExportFn } from '@/views/optionalSystem/optionUtils' |
|
|
|
import { accessChannelApi } from '@/api/optionalSystem/common' |
|
|
|
// 导出 |
|
|
|
function downloadHandle() { |
|
|
|
const params = handleParams() |
|
|
|
optionExportFn('64fdfd607b4f4356ba55d44c24ab31a2', params, '接入渠道') |
|
|
|
} |
|
|
|
onMounted(() => { |
|
|
|
getList(); |
|
|
|
getAgenCy(); |
|
|
|
}) |
|
|
|
</script> |
|
|
|
|