Commit 79d7d5e9 authored by caimeng's avatar caimeng

贷后资料下载页面完成

parent cf3d00a1
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
"dependencies": { "dependencies": {
"ali-oss": "^6.20.0", "ali-oss": "^6.20.0",
"axios": "^0.21.1", "axios": "^0.21.1",
"dayjs": "^1.11.13",
"element-ui": "^2.15.13", "element-ui": "^2.15.13",
"express": "^4.17.1", "express": "^4.17.1",
"file-saver": "^2.0.0", "file-saver": "^2.0.0",
...@@ -4790,6 +4791,11 @@ ...@@ -4790,6 +4791,11 @@
"node": "*" "node": "*"
} }
}, },
"node_modules/dayjs": {
"version": "1.11.13",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz",
"integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="
},
"node_modules/de-indent": { "node_modules/de-indent": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/de-indent/download/de-indent-1.0.2.tgz", "resolved": "https://registry.npm.taobao.org/de-indent/download/de-indent-1.0.2.tgz",
...@@ -17124,6 +17130,11 @@ ...@@ -17124,6 +17130,11 @@
"resolved": "https://registry.npmmirror.com/dateformat/-/dateformat-2.2.0.tgz", "resolved": "https://registry.npmmirror.com/dateformat/-/dateformat-2.2.0.tgz",
"integrity": "sha512-GODcnWq3YGoTnygPfi02ygEiRxqUxpJwuRHjdhJYuxpcZmDq4rjBiXYmbCCzStxo176ixfLT6i4NPwQooRySnw==" "integrity": "sha512-GODcnWq3YGoTnygPfi02ygEiRxqUxpJwuRHjdhJYuxpcZmDq4rjBiXYmbCCzStxo176ixfLT6i4NPwQooRySnw=="
}, },
"dayjs": {
"version": "1.11.13",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz",
"integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="
},
"de-indent": { "de-indent": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/de-indent/download/de-indent-1.0.2.tgz", "resolved": "https://registry.npm.taobao.org/de-indent/download/de-indent-1.0.2.tgz",
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
"dependencies": { "dependencies": {
"ali-oss": "^6.20.0", "ali-oss": "^6.20.0",
"axios": "^0.21.1", "axios": "^0.21.1",
"dayjs": "^1.11.13",
"element-ui": "^2.15.13", "element-ui": "^2.15.13",
"express": "^4.17.1", "express": "^4.17.1",
"file-saver": "^2.0.0", "file-saver": "^2.0.0",
......
<template>
<div>
</div>
</template>
<script>
export default {
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<template>
<el-form-item :label="label ? `${label}:` : ''" :prop="prop">
<component size="small" :is="`el-${component}`" v-model="currentValue" v-bind="options" v-on="$attrs.on">
<template v-if="component === 'select'">
<el-option
v-for="(item, index) in $attrs.options"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</template>
</component>
</el-form-item>
</template>
<script>
const defaultOptionMap = {
input: {
placeholder: label => `请输入${label}`,
},
select: {
placeholder: label => `请选择${label}`,
},
'date-picker': {
placeholder: label => `请选择${label}`,
valueFormat: 'yyyy-MM-dd',
},
'date-picker-daterange': {
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '至',
startPlaceholder: '开始日期',
endPlaceholder: '结束日期',
},
}
export default {
name: 'BaseFormItem',
inheritAttrs: false,
props: {
value: null,
label: String,
prop: {
type: String,
required: true,
},
component: {
type: String,
required: true,
},
},
computed: {
currentValue: {
get() {
return this.value
},
set(val) {
this.$emit('input', val)
},
},
options() {
const options = { ...this.$attrs }
const defaultOption = this.getDefaultOption()
return {
...defaultOption,
clearable: true,
...options,
}
},
},
methods: {
getDefaultOption() {
const { type } = this.$attrs
const key = type ? `${this.component}-${type}` : this.component
const defaultOption = defaultOptionMap[key] || defaultOptionMap[this.component] || {}
let placeholder = defaultOption.placeholder
if (placeholder) {
placeholder = typeof placeholder === 'function' ? placeholder(this.label) : placeholder
}
return { ...defaultOption, placeholder }
},
},
}
</script>
\ No newline at end of file
<template>
<div class="m-search">
<el-form ref="searchForm" v-model="values" inline @submit.native.prevent>
<SearchItem v-for="(item,index) in config" v-bind="item" v-model="values[item.prop]" :key="index" />
<slot name="footer">
<el-button icon="el-icon-plus" type="primary" size="small" @click="submit">搜索</el-button>
<el-button icon="el-icon-refresh-right" type="default" size="small" @click="reset">重置</el-button>
</slot>
</el-form>
</div>
</template>
<script>
import SearchItem from './form-item.vue'
export default {
name: "McSearch",
inheritAttrs: false,
components: {
SearchItem
},
props: {
value: null,
config: {
type: Array,
require: true,
default: () => []
},
onSubmit: Function,
onInput: Function
},
computed: {
values: {
get() {
return this.value || {}
},
set(val) {
this.onInput && this.onInput(val)
this.$emit('input', val)
}
}
},
watch: {
config: {
handler: 'initValues',
immediate: true,
deep: true
}
},
methods: {
initValues() {
this.values = this.config.reduce((values, item) => {
values[item.prop] = item.value
return values
}, {})
},
submit() {
const values = this.values;
this.onSubmit && this.onSubmit(values)
this.$emit('submit', values)
},
reset() {
this.$emit('reset')
this.$refs.searchForm.resetFields()
this.initValues()
this.submit()
}
},
}
</script>
<style lang="less" scoped>
.m-search{
.el-button{
margin-top: 4px;
}
}
</style>
\ No newline at end of file
export default {
name: 'ColumnRender',
functional: true,
props: {
scope: Object,
render: Function,
},
render: (h, ctx) => {
const { scope, render } = ctx.props
const { column, row, $index } = scope
return render ? render(h, row[column.property], row, $index) : ''
},
}
<template>
<el-table-column v-bind="column">
<!-- 默认插槽 -->
<template v-if="column.render" #default="scope">
<ColumnRender :scope="scope" :render="column.render" />
</template>
</el-table-column>
</template>
<script>
import ColumnRender from './column-render'
export default {
name: 'BaseColumn',
components: {
ColumnRender,
},
props: {
column: {
type: Object,
default: () => ({}),
},
},
}
</script>
<template>
<div class="common-table">
<slot name="Header"></slot>
<el-table
ref="multipleTable"
v-loading="loading"
:data="data"
v-bind="$attrs"
class="mb20"
border
v-on="$listeners"
@selection-change="handleSelectionChange"
@cell-click="tabClick"
>
<template v-for="column in finalColumns">
<el-table-column v-if="$scopedSlots[column.prop]" v-bind="column" :key="column.prop">
<template #default="scope">
<slot :name="column.prop" v-bind="scope"></slot>
</template>
</el-table-column>
<BaseColumn :key="column.prop" v-else :column="column" />
</template>
</el-table>
<BasePagination :pagination="pagination" @change="handleChange" />
</div>
</template>
<script>
import BaseColumn from './column'
import BasePagination from './pagination'
const defaultColumnOption = {
align: 'left',
showOverflowTooltip: true,
}
export default {
name: 'BaseTable',
components: {
BaseColumn,
BasePagination,
},
inheritAttrs: false,
props: {
data: Array,
columns: Array,
onChange: Function,
columnOptions: Object,
loading: {
type: Boolean,
default: false,
},
pagination: {
type: [Object, Boolean],
default: () => ({}),
},
},
computed: {
finalColumns() {
const { columnOptions, columns } = this
return columns.map(column => ({
...defaultColumnOption,
...columnOptions,
...column,
}))
},
},
methods: {
handleChange(pagination) {
if (this.onChange) {
this.onChange(pagination)
}
this.$emit('change', pagination)
},
handleSelectionChange(val) {
this.$emit('selectChange', val)
},
tabClick(row, column, cell) {
this.$emit('tabClick', row, column, cell)
},
clearSelection() {
this.$refs.multipleTable.clearSelection()
},
},
}
</script>
<style lang="less" scoped>
.common-table {
.mb20 {
margin-bottom: 20px;
}
}
</style>
<template>
<div v-if="pagination" class="common-pagination" :class="[`common-pagination--${position}`]">
<el-pagination
background
v-bind="options"
@size-change="handleChange($event, 'size')"
@current-change="handleChange($event, 'page')"
></el-pagination>
</div>
</template>
<script>
const defaultOption = {
total: 0,
currentPage: 1,
pageSize: 10,
pageSizes: [10, 20, 30, 40, 50],
layout: 'prev,pager,next,sizes,total,jumper',
}
export default {
name: 'BasePagination',
props: {
pagination: {
type: [Object, Boolean],
default: () => ({}),
},
},
computed: {
position() {
return this.pagination.position || 'right'
},
options() {
return {
...defaultOption,
...this.pagination,
currentPage: this.pagination.pageNo || this.pagination.currentPage,
}
},
},
methods: {
handleChange(val, action) {
let { currentPage: pageNo, pageSize } = this.options
if (action === 'page') {
pageNo = val
}
if (action === 'size') {
pageNo = 1
pageSize = val
}
this.$emit('change', { pageNo, pageSize })
},
},
}
</script>
<style lang="less" scoped>
.common-pagination {
display: flex;
&--left {
justify-content: flex-start;
}
&--center {
justify-content: center;
}
&--right {
justify-content: flex-end;
}
}
</style>
...@@ -43,8 +43,6 @@ ...@@ -43,8 +43,6 @@
<!-- 列表 --> <!-- 列表 -->
<div v-show="isShow"> <div v-show="isShow">
<block-header title="客户列表"/> <block-header title="客户列表"/>
<mc-table :data="list"></mc-table>
<el-table <el-table
border border
size="small" size="small"
......
...@@ -7,56 +7,67 @@ ...@@ -7,56 +7,67 @@
style="width: 100%;"> style="width: 100%;">
<el-table-column align="center" prop="clientName" label="姓名"></el-table-column> <el-table-column align="center" prop="clientName" label="姓名"></el-table-column>
<el-table-column align="center" prop="riskGmtCreated" :formatter="dateFormats" label="修改日期"></el-table-column> <el-table-column align="center" prop="riskGmtCreated" :formatter="dateFormats" label="修改日期"></el-table-column>
<el-table-column align="center" prop="riskType" label="操作人"></el-table-column> <el-table-column align="center" prop="creator" label="操作人"></el-table-column>
<el-table-column align="center" prop="riskType" label="风险等级"></el-table-column> <el-table-column align="center" prop="riskType" label="风险等级"></el-table-column>
<el-table-column align="center" prop="riskGmtCreated" :formatter="dateFormats" label="自定义解除日期"></el-table-column> <el-table-column align="center" prop="riskLifted" :formatter="dateFormats" label="自定义解除日期"></el-table-column>
<el-table-column align="center" prop="riskContent" label="风险描述"></el-table-column> <el-table-column align="center" prop="riskContent" label="风险描述"></el-table-column>
<el-table-column align="center" prop="memo" label="备注"></el-table-column> <el-table-column align="center" prop="riskImageUrl" label="资料">
<el-table-column align="center" prop="memo" label="资料"></el-table-column> <template slot-scope="scope">
<template v-if="scope.row.riskImageUrl && scope.row.riskImageUrl !== null">
<template v-for="item in scope.row.riskImageUrl">
<el-image style="width: 50px; height: 50px; margin: 0 5px; cursor: pointer;" fit="fill"
:preview-src-list="scope.row.riskImageUrl" :src="item"></el-image>
</template>
</template>
</template>
</el-table-column>
</el-table> </el-table>
<!-- 调整风险等级弹框 --> <!-- 调整风险等级弹框 -->
<template v-if="visible">
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" title="调整风险等级" width="35%" <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" title="调整风险等级" width="35%"
:visible.sync="visible" :before-close="handleCancel"> :visible.sync="visible" :before-close="handleCancel">
<div> <div>
<div class="box-agreement"> <div class="box-agreement">
<el-form label-suffix=":" :rules="rules" label-width="130px" label-position="left" :model="riskForm" <el-form label-suffix=":" :rules="rules" label-width="130px" label-position="right" :model="riskForm"
ref="form"> ref="form">
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="level" label="风险等级"> <el-form-item prop="riskType" label="风险等级">
<el-select v-model="riskForm.level" size="small" placeholder="请选择风险等级"> <el-select v-model="riskForm.riskType" size="small" placeholder="请选择风险等级">
<el-option v-for="item in this.$enumUtils.toValue('RiskLevelEnum')" :key="item.value" <el-option v-for="item in this.$enumUtils.toValue('RiskLevelEnum')" :key="item.value"
:label="item.label" :value="item.value"></el-option> :label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<template v-if="riskForm.level==='2'||riskForm.level==='3'||riskForm.level==='4'||riskForm.level==='4'"> <template
v-if="riskForm.riskType === 'R1' || riskForm.riskType === 'R2' || riskForm.riskType === 'R3' || riskForm.riskType === 'RP1'">
<el-form-item prop="raido" label="是否自定义解除"> <el-form-item prop="isRetract" label="是否自定义解除">
<el-radio-group v-model="riskForm.radio"> <el-radio-group v-model="riskForm.isRetract">
<el-radio label="YES"></el-radio> <el-radio label="1"></el-radio>
<el-radio label="NO"></el-radio> <el-radio label="0"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item v-if="riskForm.radio==='YES'" prop="time" label="自定义解除日期"> <el-form-item v-if="riskForm.isRetract === '1'" prop="riskLifted" label="自定义解除日期">
<el-date-picker size="small" v-model="riskForm.time" type="date" placeholder="选择日期"> <el-date-picker size="small" v-model="riskForm.riskLifted" type="date" placeholder="选择日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</template> </template>
<el-form-item prop="riskContent" label="风险描述">
<el-form-item prop="memo" label="风险描述"> <el-input type="textarea" :row="4" placeholder="请输入风险描述" v-model="riskForm.riskContent"></el-input>
<el-input type="textarea" :row="6" size="small" maxlength="20" show-word-limit clearable
v-model.trim="riskForm.memo" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="certNo" label="资料">
<el-form-item prop="riskImages" label="资料">
<el-upload :file-list="fileList" class="upload-demo" list-type="picture-card" :action="oss.action" <el-upload :file-list="fileList" class="upload-demo" list-type="picture-card" :action="oss.action"
:data="oss.data" :multiple="oss.multiple" accept=".jpeg,.jpg,.png" :http-request="uploadSectionFile" :data="oss.data" :multiple="oss.multiple" accept=".jpeg,.jpg,.png"
:before-upload="handleBeforeApplyUpload" :on-remove="handleLoanApplyRemove"> :http-request="uploadSectionFile" :before-upload="handleBeforeApplyUpload"
:on-remove="handleLoanApplyRemove">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
...@@ -72,6 +83,8 @@ ...@@ -72,6 +83,8 @@
<el-button size="small" type="primary" @click="onSubmit">提 交</el-button> <el-button size="small" type="primary" @click="onSubmit">提 交</el-button>
</div> </div>
</el-dialog> </el-dialog>
</template>
</div> </div>
</template> </template>
...@@ -109,36 +122,47 @@ export default { ...@@ -109,36 +122,47 @@ export default {
oss: { oss: {
action: '', action: '',
data: {}, data: {},
multiple: false, multiple: true,
}, },
file: null, file: null,
visible: false, visible: false,
rules: { rules: {
level: [ riskType: [
{ required: true, message: "请选择风险等级", trigger: 'change' } { required: true, message: "请选择风险等级", trigger: 'change' }
], ],
time: [ riskContent: [
{ required: true, message: "请输入", trigger: 'blur' }
],
riskLifted: [
{ required: true, message: "请选择解除日期", trigger: 'blur' } { required: true, message: "请选择解除日期", trigger: 'blur' }
], ],
radio: [ isRetract: [
{ required: true, message: "请选择是否解除", trigger: 'change' } { required: true, message: "请选择是否解除", trigger: 'change' }
],
memo: [
{ required: true, message: "请输入风险描述", trigger: 'blur' }
] ]
}, },
riskForm: { riskForm: {
level: "", riskType: "",
time: "", riskLifted: "",
radio: "", isRetract: "",
memo: "", riskImageUrl: null,
file: '' riskContent: '',
certNo: '',
clientName: '',
clientPhone: '',
creator: localStorage.getItem("userName"),
} }
} }
}, },
async created() { async created() {
const params = this.params; const params = this.params;
console.log(params, '传的值')
this.form.certNo = params.idCard; this.form.certNo = params.idCard;
this.riskForm.certNo = params.idCard;
this.riskForm.clientName = params.clientName;
this.riskForm.clientPhone = params.clientCell;
await this.init() await this.init()
}, },
methods: { methods: {
...@@ -155,7 +179,7 @@ export default { ...@@ -155,7 +179,7 @@ export default {
/*日期*/ /*日期*/
dateFormats: function (row, column) { dateFormats: function (row, column) {
let date = row[column.property] let date = row[column.property]
if (date === undefined) { if (!date || date === undefined) {
return '' return ''
} }
return moment(date).format("YYYY-MM-DD") return moment(date).format("YYYY-MM-DD")
...@@ -169,6 +193,8 @@ export default { ...@@ -169,6 +193,8 @@ export default {
}, },
/** 风险等级调整表单取消 */ /** 风险等级调整表单取消 */
handleCancel() { handleCancel() {
this.fileList = []
this.$refs['form'].resetFields()
this.visible = false this.visible = false
}, },
/** 风险等级调整表单提交 */ /** 风险等级调整表单提交 */
...@@ -179,11 +205,22 @@ export default { ...@@ -179,11 +205,22 @@ export default {
feedVoucher.push(item.url); feedVoucher.push(item.url);
}) })
this.$refs['ruleForm'].validate((valid) => { this.riskForm.riskImageUrl = feedVoucher
this.$refs['form'].validate(async (valid) => {
if (!valid) { if (!valid) {
return false return false
} }
console.log('干正事')
this.$confirm('确认要提交吗?').then(async _ => {
const res = await this.$$post('/risk/insertRiskLogBack', { ...this.riskForm })
if (res.data.success) {
this.$message({ message: '操作成功', type: 'success' });
this.handleCancel()
await this.init()
} else {
this.$message({ message: res.data.message, type: 'error' });
}
}).catch(_ => {});
}); });
}, },
......
import BaseSearch from '@/components/McSearch/index.vue'
import BaseTable from '@/components/McTable/index.vue'
export function FormTableMixin(service, defaultProps = {}) {
const pagination = defaultProps && {
pageNo: 1,
pageSize: 10,
total: 0,
...defaultProps,
}
return {
components: {
BaseSearch,
BaseTable,
},
data() {
return {
form: {
value: null,
onSubmit: () => {
this.table.pagination.pageNo = 1
this.getList()
},
onInput: val => {
this.form.value = val
},
},
table: {
data: [],
pagination,
loading: false,
onChange: pagination => {
Object.assign(this.table.pagination, pagination)
this.getList()
},
},
}
},
mounted() {
// let parent = this.$options.parent
// // 定位到第一个 keep-alive 父组件
// while (parent && parent.$options._componentTag !== 'keep-alive') {
// parent = parent.$parent
// }
// if (!parent) {
// this.getList()
// }
// this.getList()
},
activated() {
// 由于 keep-alive 组件的缓存机制,这里需要在 activated 生命周期中
console.log('activated');
this.getList()
},
computed: {
params() {
const { pagination } = this.table
return {
...this.form.value,
pageNum: pagination.pageNo,
pageSize: pagination.pageSize,
}
},
},
methods: {
async getList() {
this.table.loading = true
try {
const { data = [], total = 0 } = (await service?.call(this, this.params, this)) || {}
this.table.loading = false
this.table.data = data
if (this.table.pagination) {
this.table.pagination.total = total * 1
}
} catch (error) {
console.error(error);
this.table.loading = false
}
},
},
}
}
...@@ -206,6 +206,15 @@ export default new Router({ ...@@ -206,6 +206,15 @@ export default new Router({
filter: true filter: true
} }
}, },
{
path: '/collection/download',
name: 'CollectionSearch',
component: resolve => require(['../views/collection/download.vue'], resolve),
meta: {
title: '法诉材料',
filter: true
}
},
] ]
}, },
......
import { GET, POST } from "@/utils/ajax";
// 初始化下载列表
export default {
GetCollectionDownLoad(data) {
return GET('/protocol/selectProtocolEnumList', data);
},
};
/** /**
* Created by jin.zhouhang on 17-7-19 上午10:01. * Created by jin.zhouhang on 17-7-19 上午10:01.
*/ */
import axios from 'axios' import axios from "axios";
import qs from 'qs' import qs from "qs";
import Cookies from 'js-cookie' import Cookies from "js-cookie";
/** 测试环境 */ /** 测试环境 */
axios.defaults.baseURL = process.env.VUE_APP_API; axios.defaults.baseURL = process.env.VUE_APP_API;
/* 所有ajax请求拦截 */ /* 所有ajax请求拦截 */
axios.interceptors.request.use(function(req) { axios.interceptors.request.use(
const token = Cookies.get('x-auth-token') function(req) {
const token = Cookies.get("x-auth-token");
if (token) { if (token) {
req.headers['X-Auth-Token'] = token req.headers["X-Auth-Token"] = token;
// req.headers['token'] = localStorage.getItem("token_xxx") // req.headers['token'] = localStorage.getItem("token_xxx")
} }
// 在发送请求之前做些什么 // 在发送请求之前做些什么
return req return req;
}, function(error) { },
function(error) {
// 对请求错误做些什么 // 对请求错误做些什么
return Promise.reject(error) return Promise.reject(error);
}) }
);
/* 所有ajax响应拦截 */ /* 所有ajax响应拦截 */
axios.interceptors.response.use( axios.interceptors.response.use(
res => { (res) => {
const token = res.headers['x-auth-token'] const token = res.headers["x-auth-token"];
token && Cookies.set('x-auth-token', token) token && Cookies.set("x-auth-token", token);
if (res.status !== 200) { if (res.status !== 200) {
throw new Error(res) throw new Error(res);
} }
return res return res;
}, },
error => { (error) => {
return Promise.reject(error) return Promise.reject(error);
} }
) );
const Ajax = { export const GET = (url, data) => {
install(Vue) {
const $$get = (url, data) => {
if (data !== undefined) { if (data !== undefined) {
let b = true let b = true;
for (const key in data) { for (const key in data) {
if (data[key] === null) { if (data[key] === null) {
continue continue;
} }
if (b) { if (b) {
url += `?${key}=${data[key]}` url += `?${key}=${data[key]}`;
b = !b b = !b;
} else { } else {
url += `&${key}=${data[key]}` url += `&${key}=${data[key]}`;
} }
} }
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.get(url) axios
.then(res => { .get(url)
resolve(res) .then((res) => {
resolve(res);
}) })
.catch((err) => { .catch((err) => {
reject(err) reject(err);
}) });
}) });
} };
const $$post = (url, data) => { export const POST = (url, data) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.post(url, data) axios
.then(res => { .post(url, data)
resolve(res) .then((res) => {
resolve(res);
}) })
.catch((err) => { .catch((err) => {
reject(err) reject(err);
}) });
}) });
} };
const Ajax = {
install(Vue) {
const $$get = (url, data) => {
return GET(url, data);
};
const $$post = (url, data) => {
return POST(url, data);
};
const $$put = (url, data) => { const $$put = (url, data) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.put(url, data) axios
.then(res => { .put(url, data)
resolve(res) .then((res) => {
resolve(res);
}) })
.catch((err) => { .catch((err) => {
reject(err) reject(err);
}) });
}) });
} };
const $$patch = (url, data) => { const $$patch = (url, data) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.patch(url, qs.stringify(data)) axios
.then(res => { .patch(url, qs.stringify(data))
resolve(res) .then((res) => {
resolve(res);
}) })
.catch((err) => { .catch((err) => {
reject(err) reject(err);
}) });
}) });
} };
const $$delete = (url, data) => { const $$delete = (url, data) => {
if (data !== undefined) { if (data !== undefined) {
let b = true let b = true;
for (const key in data) { for (const key in data) {
if (data[key] === null) { if (data[key] === null) {
continue continue;
} }
if (b) { if (b) {
url += `?${key}=${data[key]}` url += `?${key}=${data[key]}`;
b = !b b = !b;
} else { } else {
url += `&${key}=${data[key]}` url += `&${key}=${data[key]}`;
} }
} }
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
axios.delete(url) axios
.then(res => { .delete(url)
resolve(res) .then((res) => {
resolve(res);
}) })
.catch((err) => { .catch((err) => {
reject(err) reject(err);
}) });
}) });
} };
Vue.prototype.$$ajax = axios Vue.prototype.$$ajax = axios;
Vue.prototype.$$get = $$get Vue.prototype.$$get = $$get;
Vue.prototype.$$post = $$post Vue.prototype.$$post = $$post;
Vue.prototype.$$put = $$put Vue.prototype.$$put = $$put;
Vue.prototype.$$patch = $$patch Vue.prototype.$$patch = $$patch;
Vue.prototype.$$delete = $$delete Vue.prototype.$$delete = $$delete;
} },
} };
export default Ajax export default Ajax;
\ No newline at end of file
...@@ -710,12 +710,12 @@ const enumUtils = { ...@@ -710,12 +710,12 @@ const enumUtils = {
/** 放款资方*/ /** 放款资方*/
enumOpts[21] = { enumOpts[21] = {
enumName: 'RiskLevelEnum', values: [ enumName: 'RiskLevelEnum', values: [
{value: '1', label: '解除等级'}, {value: 'R0', label: '解除等级'},
{value: '2', label: 'RP1-未到期低风险(预警)'}, {value: 'RP1', label: 'RP1-未到期低风险(预警)'},
{value: '3', label: 'R1-低风险(预警)'}, {value: 'R1', label: 'R1-低风险(预警)'},
{value: '4', label: 'R2-中风险(警告)'}, {value: 'R2', label: 'R2-中风险(警告)'},
{value: '5', label: 'R3-高风险(冻结)'}, {value: 'R3', label: 'R3-高风险(冻结)'},
{value: '6', label: 'R4-黑名单(禁止)'}, {value: 'R4', label: 'R4-黑名单(禁止)'},
] ]
}; };
......
<template>
<div class="page-download">
<block-header title="搜索" />
<BaseSearch v-bind="form" ref="search" :config="searchConfig"></BaseSearch>
<BaseTable v-bind="table" ref="table" :columns="columns"></BaseTable>
</div>
</template>
<script>
import _ from 'lodash'
import { FormTableMixin } from '@/mixins/form-table'
import dayjs from 'dayjs'
import API from '@/server/api'
// 获取列表
const service = async (params) => {
try{
const res = await API.GetCollectionDownLoad({...params})
console.log(res,'哈哈')
return {
data:'',
total:''
}
}catch{
console.log('报错了')
}
}
export default {
name: "CollectionDownload",
mixins: [FormTableMixin(service())],
data() {
return {
searchConfig: [
{
component: 'input',
prop: 'companyName',
label: '案件批次',
placeholder: '请输入案件批次'
},
{
component: 'select',
prop: 'b',
label: '状态',
placeholder: '请选择',
options: []
}
],
columns: [
{
label: '案件批次',
prop: 'companyName',
},
{
label: '案件数',
prop: 'a',
},
{
label: '状态',
prop: 'b',
},
{
label: '创建时间',
prop: 'c',
},
{
label: '更新时间',
prop: 'd',
},
{
label: '备注',
prop: 'e',
},
{
label: '操作人',
prop: 'f',
},
{
label: '创建时间',
prop: 'createdTime',
render: (_, text) => {
return <span>{text && dayjs(text).format('YYYY-MM-DD HH:mm:ss')}</span>
}
}
],
}
},
mounted() {
},
methods: {
async init() {
try {
const res = await this.$$get('/protocol/selectProtocolEnumList')
if (res.status === 200 && res.data.success) {
this.EnumList = res.data.result;
} else {
this.$message.error(res.data.message);
}
} catch (err) {
this.$message.error(res || '初始化协议枚举列表报错');
}
}
},
}
</script>
<style lang="less" scoped></style>
\ No newline at end of file
...@@ -2919,6 +2919,11 @@ ...@@ -2919,6 +2919,11 @@
"resolved" "https://registry.npmmirror.com/dateformat/-/dateformat-2.2.0.tgz" "resolved" "https://registry.npmmirror.com/dateformat/-/dateformat-2.2.0.tgz"
"version" "2.2.0" "version" "2.2.0"
"dayjs@^1.11.13":
"integrity" "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="
"resolved" "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz"
"version" "1.11.13"
"de-indent@^1.0.2": "de-indent@^1.0.2":
"integrity" "sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0=sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==" "integrity" "sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0=sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg=="
"resolved" "https://registry.npm.taobao.org/de-indent/download/de-indent-1.0.2.tgz" "resolved" "https://registry.npm.taobao.org/de-indent/download/de-indent-1.0.2.tgz"
......
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