修改政府端前端,银行端小程序和后端接口
This commit is contained in:
@@ -205,17 +205,17 @@ const routes = [
|
||||
roles: ['admin', 'manager']
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/settings',
|
||||
name: 'Settings',
|
||||
component: () => import('@/views/Settings.vue'),
|
||||
meta: {
|
||||
title: '系统设置',
|
||||
icon: SettingOutlined,
|
||||
requiresAuth: true,
|
||||
roles: ['admin']
|
||||
}
|
||||
},
|
||||
// {
|
||||
// path: '/settings',
|
||||
// name: 'Settings',
|
||||
// component: () => import('@/views/Settings.vue'),
|
||||
// meta: {
|
||||
// title: '系统设置',
|
||||
// icon: SettingOutlined,
|
||||
// requiresAuth: true,
|
||||
// roles: ['admin']
|
||||
// }
|
||||
// },
|
||||
{
|
||||
path: '/profile',
|
||||
name: 'Profile',
|
||||
|
||||
@@ -1136,6 +1136,83 @@ export const api = {
|
||||
}
|
||||
},
|
||||
|
||||
// 贷款解押API
|
||||
loanReleases: {
|
||||
/**
|
||||
* 获取贷款解押列表
|
||||
* @param {Object} params - 查询参数
|
||||
* @returns {Promise} 解押列表
|
||||
*/
|
||||
async getList(params = {}) {
|
||||
return api.get('/loan-releases', { params })
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取贷款解押详情
|
||||
* @param {number} id - 解押ID
|
||||
* @returns {Promise} 解押详情
|
||||
*/
|
||||
async getById(id) {
|
||||
return api.get(`/loan-releases/${id}`)
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建贷款解押申请
|
||||
* @param {Object} data - 解押数据
|
||||
* @returns {Promise} 创建结果
|
||||
*/
|
||||
async create(data) {
|
||||
return api.post('/loan-releases', data)
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新贷款解押申请
|
||||
* @param {number} id - 解押ID
|
||||
* @param {Object} data - 解押数据
|
||||
* @returns {Promise} 更新结果
|
||||
*/
|
||||
async update(id, data) {
|
||||
return api.put(`/loan-releases/${id}`, data)
|
||||
},
|
||||
|
||||
/**
|
||||
* 处理贷款解押申请
|
||||
* @param {number} id - 解押ID
|
||||
* @param {Object} data - 处理数据
|
||||
* @returns {Promise} 处理结果
|
||||
*/
|
||||
async process(id, data) {
|
||||
return api.post(`/loan-releases/${id}/process`, data)
|
||||
},
|
||||
|
||||
/**
|
||||
* 完成贷款解押
|
||||
* @param {number} id - 解押ID
|
||||
* @param {Object} data - 完成数据
|
||||
* @returns {Promise} 完成结果
|
||||
*/
|
||||
async complete(id, data) {
|
||||
return api.post(`/loan-releases/${id}/complete`, data)
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除贷款解押申请
|
||||
* @param {number} id - 解押ID
|
||||
* @returns {Promise} 删除结果
|
||||
*/
|
||||
async delete(id) {
|
||||
return api.delete(`/loan-releases/${id}`)
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取解押统计信息
|
||||
* @returns {Promise} 统计信息
|
||||
*/
|
||||
async getStats() {
|
||||
return api.get('/loan-releases/stats')
|
||||
}
|
||||
},
|
||||
|
||||
// 员工管理API
|
||||
employees: {
|
||||
/**
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
</a-form>
|
||||
|
||||
<div class="login-footer">
|
||||
<p>默认账户:admin / Admin123456</p>
|
||||
<p>默认账户:admin / 123456</p>
|
||||
<p>测试账户:testuser / Test123456</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -193,6 +193,7 @@
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { SearchOutlined } from '@ant-design/icons-vue'
|
||||
import { api } from '@/utils/api'
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false)
|
||||
@@ -297,189 +298,8 @@ const columns = [
|
||||
}
|
||||
]
|
||||
|
||||
// 模拟解押数据
|
||||
const releases = ref([
|
||||
{
|
||||
id: 1,
|
||||
applicationNumber: '20240227145555918',
|
||||
productName: '中国工商银行扎旗支行"畜禽活体抵押"',
|
||||
farmerName: '刘超',
|
||||
applicantName: '1',
|
||||
applicantIdNumber: '511***********3017',
|
||||
applicantPhone: '138****0459',
|
||||
assetType: '牛',
|
||||
releaseQuantity: '10头',
|
||||
releaseAmount: 10000.00,
|
||||
status: 'released',
|
||||
applicationTime: '2024-02-27 14:55:55',
|
||||
history: [
|
||||
{
|
||||
id: 1,
|
||||
action: 'apply',
|
||||
operator: '刘超',
|
||||
time: '2024-02-27 14:55:55',
|
||||
comment: '提交解押申请'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
action: 'complete',
|
||||
operator: '系统',
|
||||
time: '2024-02-27 15:30:00',
|
||||
comment: '解押手续办理完成'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
applicationNumber: '20240226113416302',
|
||||
productName: '惠农贷',
|
||||
farmerName: '刘超',
|
||||
applicantName: '1',
|
||||
applicantIdNumber: '511***********3017',
|
||||
applicantPhone: '138****0459',
|
||||
assetType: '牛',
|
||||
releaseQuantity: '10头',
|
||||
releaseAmount: 0.00,
|
||||
status: 'released',
|
||||
applicationTime: '2024-02-26 11:34:16',
|
||||
history: [
|
||||
{
|
||||
id: 1,
|
||||
action: 'apply',
|
||||
operator: '刘超',
|
||||
time: '2024-02-26 11:34:16',
|
||||
comment: '提交解押申请'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
action: 'complete',
|
||||
operator: '系统',
|
||||
time: '2024-02-26 12:00:00',
|
||||
comment: '解押手续办理完成'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
applicationNumber: '20240223140542290',
|
||||
productName: '惠农贷',
|
||||
farmerName: '刘超',
|
||||
applicantName: '张洪彬',
|
||||
applicantIdNumber: '511***********3017',
|
||||
applicantPhone: '138****0459',
|
||||
assetType: '牛',
|
||||
releaseQuantity: '10头',
|
||||
releaseAmount: 1000000.00,
|
||||
status: 'released',
|
||||
applicationTime: '2024-02-23 14:05:42',
|
||||
history: [
|
||||
{
|
||||
id: 1,
|
||||
action: 'apply',
|
||||
operator: '张洪彬',
|
||||
time: '2024-02-23 14:05:42',
|
||||
comment: '提交解押申请'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
action: 'complete',
|
||||
operator: '系统',
|
||||
time: '2024-02-23 15:00:00',
|
||||
comment: '解押手续办理完成'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
applicationNumber: '20231131890123456',
|
||||
productName: '中国工商银行扎旗支行"畜禽活体抵押"',
|
||||
farmerName: '田小平',
|
||||
applicantName: '田小平',
|
||||
applicantIdNumber: '150***********3140',
|
||||
applicantPhone: '139****5685',
|
||||
assetType: '牛',
|
||||
releaseQuantity: '30头',
|
||||
releaseAmount: 420000.00,
|
||||
status: 'released',
|
||||
applicationTime: '2023-11-31 08:90:12',
|
||||
history: [
|
||||
{
|
||||
id: 1,
|
||||
action: 'apply',
|
||||
operator: '田小平',
|
||||
time: '2023-11-31 08:90:12',
|
||||
comment: '提交解押申请'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
action: 'complete',
|
||||
operator: '系统',
|
||||
time: '2023-11-31 10:00:00',
|
||||
comment: '解押手续办理完成'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
applicationNumber: '20231131789012345',
|
||||
productName: '中国农业银行扎旗支行"畜禽活体抵押"',
|
||||
farmerName: '杜宝民',
|
||||
applicantName: '杜宝民',
|
||||
applicantIdNumber: '150***********7238',
|
||||
applicantPhone: '159****2749',
|
||||
assetType: '牛',
|
||||
releaseQuantity: '30头',
|
||||
releaseAmount: 420000.00,
|
||||
status: 'released',
|
||||
applicationTime: '2023-11-31 07:89:01',
|
||||
history: [
|
||||
{
|
||||
id: 1,
|
||||
action: 'apply',
|
||||
operator: '杜宝民',
|
||||
time: '2023-11-31 07:89:01',
|
||||
comment: '提交解押申请'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
action: 'complete',
|
||||
operator: '系统',
|
||||
time: '2023-11-31 09:00:00',
|
||||
comment: '解押手续办理完成'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
applicationNumber: '20231131901234567',
|
||||
productName: '中国农业银行扎旗支行"畜禽活体抵押"',
|
||||
farmerName: '满良',
|
||||
applicantName: '满良',
|
||||
applicantIdNumber: '150***********5140',
|
||||
applicantPhone: '158****9502',
|
||||
assetType: '牛',
|
||||
releaseQuantity: '38头',
|
||||
releaseAmount: 530000.00,
|
||||
status: 'released',
|
||||
applicationTime: '2023-11-31 09:01:23',
|
||||
history: [
|
||||
{
|
||||
id: 1,
|
||||
action: 'apply',
|
||||
operator: '满良',
|
||||
time: '2023-11-31 09:01:23',
|
||||
comment: '提交解押申请'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
action: 'complete',
|
||||
operator: '系统',
|
||||
time: '2023-11-31 11:00:00',
|
||||
comment: '解押手续办理完成'
|
||||
}
|
||||
]
|
||||
}
|
||||
])
|
||||
// 解押数据
|
||||
const releases = ref([])
|
||||
|
||||
// 计算属性
|
||||
const filteredReleases = computed(() => {
|
||||
@@ -506,8 +326,55 @@ const filteredReleases = computed(() => {
|
||||
})
|
||||
|
||||
// 方法
|
||||
// 获取解押申请列表
|
||||
const fetchReleases = async () => {
|
||||
try {
|
||||
loading.value = true
|
||||
const params = {
|
||||
page: pagination.value.current,
|
||||
pageSize: pagination.value.pageSize,
|
||||
searchField: searchQuery.value.field,
|
||||
searchValue: searchQuery.value.value
|
||||
}
|
||||
|
||||
const response = await api.loanReleases.getList(params)
|
||||
|
||||
if (response.success) {
|
||||
releases.value = response.data.releases
|
||||
pagination.value.total = response.data.pagination.total
|
||||
} else {
|
||||
message.error('获取解押申请列表失败')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取解押申请列表失败:', error)
|
||||
message.error('获取解押申请列表失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 获取解押申请详情
|
||||
const fetchReleaseDetail = async (id) => {
|
||||
try {
|
||||
const response = await api.loanReleases.getById(id)
|
||||
|
||||
if (response.success) {
|
||||
selectedRelease.value = response.data
|
||||
return response.data
|
||||
} else {
|
||||
message.error('获取解押申请详情失败')
|
||||
return null
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取解押申请详情失败:', error)
|
||||
message.error('获取解押申请详情失败')
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
const handleSearch = () => {
|
||||
// 搜索逻辑已在计算属性中处理
|
||||
pagination.value.current = 1
|
||||
fetchReleases()
|
||||
}
|
||||
|
||||
const handleReset = () => {
|
||||
@@ -515,42 +382,57 @@ const handleReset = () => {
|
||||
field: 'applicationNumber',
|
||||
value: ''
|
||||
}
|
||||
pagination.value.current = 1
|
||||
fetchReleases()
|
||||
}
|
||||
|
||||
const handleTableChange = (pag) => {
|
||||
pagination.value.current = pag.current
|
||||
pagination.value.pageSize = pag.pageSize
|
||||
fetchReleases()
|
||||
}
|
||||
|
||||
const handleView = (record) => {
|
||||
selectedRelease.value = record
|
||||
detailModalVisible.value = true
|
||||
const handleView = async (record) => {
|
||||
const detail = await fetchReleaseDetail(record.id)
|
||||
if (detail) {
|
||||
detailModalVisible.value = true
|
||||
}
|
||||
}
|
||||
|
||||
const handleEdit = (record) => {
|
||||
message.info(`编辑解押申请: ${record.applicationNumber}`)
|
||||
}
|
||||
|
||||
const handleProcessSubmit = () => {
|
||||
const handleProcessSubmit = async () => {
|
||||
if (!processForm.value.comment) {
|
||||
message.error('请输入处理意见')
|
||||
return
|
||||
}
|
||||
|
||||
const newStatus = processForm.value.result === 'approve' ? 'processing' : 'rejected'
|
||||
selectedRelease.value.status = newStatus
|
||||
selectedRelease.value.processTime = new Date().toLocaleString()
|
||||
try {
|
||||
const response = await api.loanReleases.process(selectedRelease.value.id, {
|
||||
action: processForm.value.result,
|
||||
comment: processForm.value.comment,
|
||||
remark: processForm.value.remark
|
||||
})
|
||||
|
||||
selectedRelease.value.history.push({
|
||||
id: Date.now(),
|
||||
action: processForm.value.result,
|
||||
operator: '当前用户',
|
||||
time: new Date().toLocaleString(),
|
||||
comment: processForm.value.comment
|
||||
})
|
||||
|
||||
processModalVisible.value = false
|
||||
message.success('处理完成')
|
||||
if (response.success) {
|
||||
message.success('处理完成')
|
||||
processModalVisible.value = false
|
||||
processForm.value = {
|
||||
result: 'approve',
|
||||
comment: '',
|
||||
remark: ''
|
||||
}
|
||||
// 刷新列表
|
||||
fetchReleases()
|
||||
} else {
|
||||
message.error('处理失败')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('处理解押申请失败:', error)
|
||||
message.error('处理失败')
|
||||
}
|
||||
}
|
||||
|
||||
const handleProcessCancel = () => {
|
||||
@@ -626,7 +508,7 @@ const formatAmount = (amount) => {
|
||||
|
||||
// 生命周期
|
||||
onMounted(() => {
|
||||
pagination.value.total = releases.value.length
|
||||
fetchReleases()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user