{ | { | ||||
path: "/views/interfaceManage/channelConfig", | path: "/views/interfaceManage/channelConfig", | ||||
name: "channelConfig", | name: "channelConfig", | ||||
meta: { title: "来源方配置", isAuth: true }, //用户自定内容 | |||||
meta: { title: "渠道方配置", isAuth: true }, //用户自定内容 | |||||
components: { | components: { | ||||
key: () => import("@/views/interfaceManage/channelConfig/index.vue"), | key: () => import("@/views/interfaceManage/channelConfig/index.vue"), | ||||
}, | }, |
clearable | clearable | ||||
v-model="searchForm.sourceIdentId" | v-model="searchForm.sourceIdentId" | ||||
style="width: 200px" | style="width: 200px" | ||||
placeholder="请输入来源方ID" | |||||
placeholder="请输入appId" | |||||
/> | /> | ||||
<el-input | <el-input | ||||
maxlength="60" | maxlength="60" | ||||
style="width: 200px" | style="width: 200px" | ||||
placeholder="请输入机构编码" | placeholder="请输入机构编码" | ||||
/> | /> | ||||
<!-- <el-select | |||||
clearable | |||||
v-model="searchForm.institutionalCode" | |||||
style="width: 280px" | |||||
placeholder="请选择渠道" | |||||
v-if="typeOption !== 'view'" | |||||
filterable | |||||
> | |||||
<el-option | |||||
v-for="item in appidOptions" | |||||
:key="item.value" | |||||
:label="item.label" | |||||
:value="item.value" | |||||
/> | |||||
</el-select> --> | |||||
<el-select | <el-select | ||||
clearable | clearable | ||||
v-model="searchForm.status" | v-model="searchForm.status" | ||||
/> | /> | ||||
<span v-else>{{ addForm.sourceIdentId }}</span> | <span v-else>{{ addForm.sourceIdentId }}</span> | ||||
</el-form-item> | </el-form-item> | ||||
<el-form-item label="渠道名称:" prop="sourceIdentName"> | |||||
<el-input | |||||
<el-form-item label="渠道名称:" prop="institutionalCode"> | |||||
<el-select | |||||
clearable | |||||
v-model="addForm.institutionalCode" | |||||
style="width: 100%" | |||||
placeholder="请选择渠道" | |||||
v-if="typeOption !== 'view'" | |||||
@change="institutionalCodeChange" | |||||
filterable | |||||
> | |||||
<el-option | |||||
v-for="item in appidOptions" | |||||
:key="item.value" | |||||
:label="item.label" | |||||
:value="item.value" | |||||
/> | |||||
</el-select> | |||||
<!-- <el-input | |||||
maxlength="60" | maxlength="60" | ||||
v-trim | v-trim | ||||
clearable | clearable | ||||
v-model="addForm.sourceIdentName" | v-model="addForm.sourceIdentName" | ||||
placeholder="请输入渠道名称" | placeholder="请输入渠道名称" | ||||
v-if="typeOption !== 'view'" | v-if="typeOption !== 'view'" | ||||
/> | |||||
/> --> | |||||
<span v-else>{{ addForm.sourceIdentName }}</span> | <span v-else>{{ addForm.sourceIdentName }}</span> | ||||
</el-form-item> | </el-form-item> | ||||
<el-form-item label="机构编码:" prop="institutionalCode"> | <el-form-item label="机构编码:" prop="institutionalCode"> | ||||
clearable | clearable | ||||
v-model="addForm.institutionalCode" | v-model="addForm.institutionalCode" | ||||
placeholder="请输入机构编码" | placeholder="请输入机构编码" | ||||
:disabled="true" | |||||
v-if="typeOption !== 'view'" | v-if="typeOption !== 'view'" | ||||
/> | /> | ||||
<span v-else>{{ addForm.institutionalCode }}</span> | <span v-else>{{ addForm.institutionalCode }}</span> | ||||
copyInput.remove() // 移除元素 | copyInput.remove() // 移除元素 | ||||
} | } | ||||
} | } | ||||
const searchForm = ref({ | const searchForm = ref({ | ||||
sourceIdentId: '', //来源方ID | sourceIdentId: '', //来源方ID | ||||
sourceIdentName: '', //来源方名称 | sourceIdentName: '', //来源方名称 | ||||
} | } | ||||
}) | }) | ||||
} | } | ||||
const appidOptions = ref<any>([]) | |||||
const getAppidOptions = () => { | |||||
BaseService.post('/userw/agency/listByNameLike', { name: '黔通' }).then( | |||||
(res: any) => { | |||||
if (res && res.code === 0) { | |||||
let bizContent = res.data | |||||
console.log('====interfaceConfig', bizContent) | |||||
appidOptions.value = bizContent.map((item) => { | |||||
return { | |||||
value: item.key, | |||||
label: item.value, | |||||
} | |||||
}) | |||||
} else { | |||||
ElMessage.error(res.message) | |||||
} | |||||
formLoding.value = false | |||||
} | |||||
) | |||||
} | |||||
function institutionalCodeChange(val) { | |||||
addForm.value.sourceIdentName = appidOptions.value.find( | |||||
(item) => item.value === val | |||||
)?.label | |||||
} | |||||
function getRow(id: string) { | function getRow(id: string) { | ||||
BaseService.post('/ifmw/ident/querybyid', { id: id }).then((res: any) => { | BaseService.post('/ifmw/ident/querybyid', { id: id }).then((res: any) => { | ||||
if (res && res.code === 0) { | if (res && res.code === 0) { | ||||
} | } | ||||
onMounted(() => { | onMounted(() => { | ||||
getList() | getList() | ||||
getAppidOptions() | |||||
}) | }) | ||||
function resetKey(row, type) { | function resetKey(row, type) { | ||||
let text = type === 'SM3' ? '签名密钥' : '加密密钥' | let text = type === 'SM3' ? '签名密钥' : '加密密钥' | ||||
ElMessageBox.confirm(`确定要重置 ${row.sourceIdentName} 的 ${text}吗?`, '提示', { | |||||
confirmButtonText: '确定', | |||||
cancelButtonText: '取消', | |||||
type: 'warning', | |||||
}).then(() => { | |||||
ElMessageBox.confirm( | |||||
`确定要重置 ${row.sourceIdentName} 的 ${text}吗?`, | |||||
'提示', | |||||
{ | |||||
confirmButtonText: '确定', | |||||
cancelButtonText: '取消', | |||||
type: 'warning', | |||||
} | |||||
).then(() => { | |||||
// 确定 | // 确定 | ||||
BaseService.post('/ifmw/secret/reset', { | BaseService.post('/ifmw/secret/reset', { | ||||
sourceIdentId: row.sourceIdentId, | sourceIdentId: row.sourceIdentId, |
</crud-template> | </crud-template> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<!-- 推广发行产品 --> | |||||
<script setup lang="ts"> | <script setup lang="ts"> | ||||
import { | import { | ||||
ref, | ref, | ||||
} | } | ||||
}) | }) | ||||
} | } | ||||
const agencyqueryallListOptions = ref([]) | |||||
function handleget(idx: any, row: any) { | |||||
const data = toRaw(row) | |||||
BaseService.post('/managew/api/product/promoteDistribute/del', { | |||||
promoteId: data.promoteId, | |||||
}).then((res: any) => { | |||||
if (res && res.statusCode === 0) { | |||||
ElMessage.success('删除成功') | |||||
getList() | |||||
cancel() | |||||
} else { | |||||
ElMessage.error(res.message || res.errorMsg) | |||||
} | |||||
}) | |||||
} | |||||
function completeAudit() { | function completeAudit() { | ||||
getList() | getList() | ||||
assignment(form, '') | assignment(form, '') | ||||
} | } | ||||
const afterSaleFeesList = ref([]) | const afterSaleFeesList = ref([]) | ||||
const afterSaleRef = ref(null) | |||||
const afterSaleRef = ref<any>(null) | |||||
// 编辑按钮 | // 编辑按钮 | ||||
function handleEdit(idx: any, row: any) { | function handleEdit(idx: any, row: any) { | ||||
typeOption.value = 'edit' | typeOption.value = 'edit' | ||||
handleEditKou(row) | handleEditKou(row) | ||||
handleAfterFee(row) | handleAfterFee(row) | ||||
} | } | ||||
function handleNumToStr(arr: any) { | |||||
let newArr: any = [] | |||||
if (typeof arr === 'number') { | |||||
return arr.toString() | |||||
} | |||||
if (Array.isArray(arr)) { | |||||
arr.forEach((item) => { | |||||
newArr.push(handleNumToStr(item) || '') | |||||
}) | |||||
} | |||||
return newArr | |||||
} | |||||
function handleAfterFee(data) { | function handleAfterFee(data) { | ||||
data.afterSaleFees.forEach((item) => { | data.afterSaleFees.forEach((item) => { | ||||
item.fee = item.fee / 100 | item.fee = item.fee / 100 | ||||
let text = isFeeListType.value === 1 ? '办理费' : '使用费' | let text = isFeeListType.value === 1 ? '办理费' : '使用费' | ||||
feeListRef.value.ruleFormRef.validate((valid: any, fields: any) => { | feeListRef.value.ruleFormRef.validate((valid: any, fields: any) => { | ||||
if (!valid) return ElMessage.error(`${text} 存在必填项为空!`) | if (!valid) return ElMessage.error(`${text} 存在必填项为空!`) | ||||
afterSaleRef.value.ruleFormRef.validate((valid: any, fields: any) => { | |||||
afterSaleRef.value?.ruleFormRef.validate((valid: any, fields: any) => { | |||||
if (!valid) return ElMessage.error(`售后费存在必填项为空!`) | if (!valid) return ElMessage.error(`售后费存在必填项为空!`) | ||||
msgConfirm( | |||||
`当前扣款配置会影响产品办理费和通行费的收取,请慎重决定`, | |||||
typeTy.warning | |||||
).then(() => { | |||||
let api = '/managew/api/product/promoteDistribute/add' | |||||
let api = '/managew/api/product/promoteDistribute/add' | |||||
let datas = JSON.parse(JSON.stringify(toRaw(data))) | |||||
if (typeOption.value === 'edit') { | |||||
api = '/managew/api/product/promoteDistribute/update' | |||||
} | |||||
datas.channelList = datas.agencyId | |||||
if (isFeeListType.value == 1) { | |||||
datas.processingFeeList = feeListData.value | |||||
} else { | |||||
datas.useFeeList = feeListData.value | |||||
} | |||||
afterSaleFeesList.value | |||||
datas.afterSaleFees = JSON.parse(JSON.stringify(afterSaleFeesList.value)) | |||||
datas.afterSaleFees.forEach((item) => { | |||||
item.fee = item.fee * 100 | |||||
}) | |||||
console.log(data, datas, '修改新增请求') | |||||
datas.issueScope = issueScopeData.value | |||||
BaseService.post(api, datas).then((res: any) => { | |||||
if (res && res.statusCode === 0) { | |||||
ElMessage.success('操作成功') | |||||
getList() | |||||
cancel() | |||||
let datas = JSON.parse(JSON.stringify(toRaw(data))) | |||||
if (typeOption.value === 'edit') { | |||||
api = '/managew/api/product/promoteDistribute/update' | |||||
} | |||||
datas.channelList = datas.agencyId | |||||
if (isFeeListType.value == 1) { | |||||
datas.processingFeeList = feeListData.value | |||||
} else { | |||||
datas.useFeeList = feeListData.value | |||||
} | } | ||||
afterSaleFeesList.value | |||||
datas.afterSaleFees = JSON.parse( | |||||
JSON.stringify(afterSaleFeesList.value) | |||||
) | |||||
datas.afterSaleFees.forEach((item) => { | |||||
item.fee = item.fee * 100 | |||||
}) | |||||
console.log(data, datas, '修改新增请求') | |||||
datas.issueScope = issueScopeData.value | |||||
BaseService.post(api, datas).then((res: any) => { | |||||
if (res && res.statusCode === 0) { | |||||
ElMessage.success('操作成功') | |||||
getList() | |||||
cancel() | |||||
} | |||||
}) | |||||
}) | }) | ||||
}) | }) | ||||
}) | }) | ||||
{ | { | ||||
prop: 'isFeeListTitle', | prop: 'isFeeListTitle', | ||||
hide: true, | hide: true, | ||||
label: isFeeListTitle, | |||||
label: '办理费/使用费', | |||||
form: { | form: { | ||||
width: '90%', | width: '90%', | ||||
type: 'title', | type: 'title', |
{ value: true, label: '是' }, | { value: true, label: '是' }, | ||||
{ value: false, label: '否' }, | { value: false, label: '否' }, | ||||
] | ] | ||||
// 费用类型 | |||||
// 收费方式 | |||||
const expenseTypeOptions = [ | const expenseTypeOptions = [ | ||||
{ value: 1, label: '办理费' }, | { value: 1, label: '办理费' }, | ||||
{ value: 2, label: '使用费' }, | { value: 2, label: '使用费' }, | ||||
}, | }, | ||||
{ | { | ||||
prop: 'expenseType', | prop: 'expenseType', | ||||
label: '费用类型', | |||||
label: '收费方式', | |||||
hide: true, | hide: true, | ||||
listData: expenseTypeOptions, | listData: expenseTypeOptions, | ||||
form: { | form: { |