案件管理页面接口对接
This commit is contained in:
123
src/api/calibration/caseManagement/index.ts
Normal file
123
src/api/calibration/caseManagement/index.ts
Normal file
@@ -0,0 +1,123 @@
|
||||
import request from '@/utils/request'
|
||||
const AUTH_BASE_URL = '/api2'
|
||||
|
||||
/*
|
||||
* 案件管理
|
||||
* */
|
||||
|
||||
// 新增案件
|
||||
export const BusinessCasemanagement = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('user_id', data.user_id)
|
||||
formData.append('times', data.times)
|
||||
formData.append('AgencyContract', data.AgencyContract)
|
||||
formData.append('Contractreturn', data.Contractreturn)
|
||||
formData.append('Closingapplication', data.Closingapplication)
|
||||
formData.append('ChangeRequest', data.ChangeRequest)
|
||||
formData.append('paymentcollection', data.paymentcollection)
|
||||
formData.append('personincharge', data.personincharge)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/casemanagement`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 案件分页查询
|
||||
export const BusinessCasemanagementdetail = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('page', data.pageNum)
|
||||
formData.append('per_page', data.pageSize)
|
||||
if (data.times && data.times.length) {
|
||||
formData.append('times', data.times[0])
|
||||
formData.append('end_time', data.times[1])
|
||||
}
|
||||
formData.append('type', data.type)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/casemanagementdetail`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 案件已收款(累加)
|
||||
export const BusinessAccumulate = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('user_id', data.user_id)
|
||||
formData.append('paymentcollection', data.paymentcollection)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/accumulate`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 上传发票
|
||||
export const BusinessUploadinvoice = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('user_id', data.user_id)
|
||||
formData.append('amount', data.amount)
|
||||
formData.append('file', data.file)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/uploadinvoice`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 发票详情
|
||||
export const BusinessInvoicedetail = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/invoicedetail`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 案件日志
|
||||
export const BusinessLog = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('content', data.content)
|
||||
formData.append('file', data.file)
|
||||
formData.append('user_id', data.user_id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/log`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 案件日志分页查询
|
||||
export const BusinessLogdetail = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('page', data.pageNum)
|
||||
formData.append('per_page', data.pageSize)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/logdetail`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -52,3 +52,11 @@ export const BusinessRegistrationlist = () => {
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 预立案关联立案列表接口
|
||||
export const BusinessPreFilingLinkedCases = () => {
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/preFilingLinkedCases`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -206,9 +206,9 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'user',
|
||||
name: 'CaseUser',
|
||||
component: () => import('@/views/case/index.vue'),
|
||||
path: 'caseManagement',
|
||||
name: 'CaseManagement',
|
||||
component: () => import('@/views/calibration/caseManagement/index.vue'),
|
||||
meta: {
|
||||
title: '案件管理'
|
||||
}
|
||||
|
||||
@@ -70,18 +70,32 @@ export function convertFilePathsToObject(filePaths: string | string[]): Array<{
|
||||
}
|
||||
}
|
||||
|
||||
// 自动补全协议头
|
||||
let fullPath = path
|
||||
if (!path.startsWith('http://') && !path.startsWith('https://')) {
|
||||
fullPath = `http://${path}`
|
||||
}
|
||||
|
||||
// 分割域名和文件部分
|
||||
const parts = path.split('/')
|
||||
const domain = parts[0] || ''
|
||||
const filePart = parts.slice(1).join('/') || ''
|
||||
const urlObj = new URL(fullPath)
|
||||
const domain = urlObj.origin
|
||||
const filePart = urlObj.pathname.substring(1) // 移除开头的 /
|
||||
|
||||
// 分割文件名和UUID
|
||||
const lastUnderscoreIndex = filePart.lastIndexOf('_')
|
||||
const name = lastUnderscoreIndex > 0 ? filePart.substring(0, lastUnderscoreIndex) : filePart
|
||||
let name = lastUnderscoreIndex > 0 ? filePart.substring(0, lastUnderscoreIndex) : filePart
|
||||
const uuid = lastUnderscoreIndex > 0 ? filePart.substring(lastUnderscoreIndex + 1) : ''
|
||||
|
||||
// 解码 URL 编码的文件名
|
||||
try {
|
||||
name = decodeURIComponent(name)
|
||||
} catch (e) {
|
||||
// 如果解码失败,保持原始文件名
|
||||
console.warn('文件名解码失败:', name)
|
||||
}
|
||||
|
||||
return {
|
||||
url: path,
|
||||
url: fullPath,
|
||||
domain,
|
||||
name,
|
||||
uuid
|
||||
|
||||
@@ -2,6 +2,8 @@ import { ElButton, ElDialog } from 'element-plus'
|
||||
import { Component, DefineComponent } from 'vue'
|
||||
import { h, createApp } from 'vue'
|
||||
import { throttle } from '@/utils/auxiliaryFunction'
|
||||
import ElementPlus from 'element-plus'
|
||||
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
||||
|
||||
// 定义模态框属性接口
|
||||
interface ModalProps {
|
||||
@@ -9,6 +11,7 @@ interface ModalProps {
|
||||
width?: string | number
|
||||
ok?: (result: any) => void
|
||||
cancel?: () => void
|
||||
footerVisible?: boolean
|
||||
[key: string]: any // 允许其他 Element Plus Dialog 属性
|
||||
}
|
||||
|
||||
@@ -39,24 +42,31 @@ export const functionDialogBox = (
|
||||
},
|
||||
{
|
||||
default: () => h(component || h('div'), { ref: formRef, ...props }),
|
||||
footer: () => [
|
||||
h(
|
||||
ElButton,
|
||||
{
|
||||
type: 'primary',
|
||||
loading: isLoading.value,
|
||||
onClick: confirm
|
||||
},
|
||||
() => '确定'
|
||||
),
|
||||
h(
|
||||
ElButton,
|
||||
{
|
||||
onClick: cancel
|
||||
},
|
||||
() => '取消'
|
||||
)
|
||||
]
|
||||
footer: () => {
|
||||
// 如果 footerVisible 为 false 或 undefined,默认显示 footer
|
||||
if (modalProps.footerVisible !== false) {
|
||||
return [
|
||||
h(
|
||||
ElButton,
|
||||
{
|
||||
type: 'primary',
|
||||
loading: isLoading.value,
|
||||
onClick: confirm
|
||||
},
|
||||
() => '确定'
|
||||
),
|
||||
h(
|
||||
ElButton,
|
||||
{
|
||||
onClick: cancel
|
||||
},
|
||||
() => '取消'
|
||||
)
|
||||
]
|
||||
}
|
||||
// 返回 null 或不返回 footer slot
|
||||
return null
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
@@ -64,6 +74,9 @@ export const functionDialogBox = (
|
||||
|
||||
const div = document.createElement('div')
|
||||
document.body.appendChild(div)
|
||||
app.use(ElementPlus, {
|
||||
locale: zhCn
|
||||
})
|
||||
app.mount(div)
|
||||
|
||||
function unmount() {
|
||||
|
||||
@@ -41,7 +41,38 @@
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column label="预立案" prop="user_id" />
|
||||
<el-table-column label="委托人信息" prop="client_username">
|
||||
<el-table-column v-slot="{ row }" prop="client_username" label="自然人姓名/法人名称">
|
||||
{{
|
||||
JSON.parse(row.client_username)
|
||||
.map((item: any) => item.name)
|
||||
.join(',')
|
||||
}}
|
||||
</el-table-column>
|
||||
<el-table-column v-slot="{ row }" prop="client_username" label="身份证号码/统一代码">
|
||||
{{
|
||||
JSON.parse(row.client_username)
|
||||
.map((item: any) => item.idNumber)
|
||||
.join(',')
|
||||
}}
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="相对方信息" prop="party_username">
|
||||
<el-table-column v-slot="{ row }" prop="party_username" label="自然人姓名/法人名称">
|
||||
{{
|
||||
JSON.parse(row.party_username)
|
||||
.map((item: any) => item.name)
|
||||
.join(',')
|
||||
}}
|
||||
</el-table-column>
|
||||
<el-table-column v-slot="{ row }" prop="party_username" label="身份证号码/统一代码">
|
||||
{{
|
||||
JSON.parse(row.party_username)
|
||||
.map((item: any) => item.idNumber)
|
||||
.join(',')
|
||||
}}
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目类型" align="center" prop="type" />
|
||||
<el-table-column label="合同编号" align="center" prop="ContractNo" />
|
||||
<el-table-column label="负责人" align="center" prop="responsiblefor" />
|
||||
@@ -96,7 +127,38 @@
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column label="预立案" prop="user_id" />
|
||||
<el-table-column label="委托人信息" prop="client_username">
|
||||
<el-table-column v-slot="{ row }" prop="client_username" label="自然人姓名/法人名称">
|
||||
{{
|
||||
JSON.parse(row.client_username)
|
||||
.map((item: any) => item.name)
|
||||
.join(',')
|
||||
}}
|
||||
</el-table-column>
|
||||
<el-table-column v-slot="{ row }" prop="client_username" label="身份证号码/统一代码">
|
||||
{{
|
||||
JSON.parse(row.client_username)
|
||||
.map((item: any) => item.idNumber)
|
||||
.join(',')
|
||||
}}
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="相对方信息" prop="party_username">
|
||||
<el-table-column v-slot="{ row }" prop="party_username" label="自然人姓名/法人名称">
|
||||
{{
|
||||
JSON.parse(row.party_username)
|
||||
.map((item: any) => item.name)
|
||||
.join(',')
|
||||
}}
|
||||
</el-table-column>
|
||||
<el-table-column v-slot="{ row }" prop="party_username" label="身份证号码/统一代码">
|
||||
{{
|
||||
JSON.parse(row.party_username)
|
||||
.map((item: any) => item.idNumber)
|
||||
.join(',')
|
||||
}}
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="招标单位信息" align="center" prop="BiddingUnit">
|
||||
<el-table-column v-slot="{ row }" prop="BiddingUnit" label="自然人姓名/法人名称">
|
||||
{{
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<div class="pre-registration-form">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="auto"
|
||||
label-position="top"
|
||||
>
|
||||
<el-form-item label="金额" prop="amount">
|
||||
<el-input v-model="formData.amount" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发票" prop="file">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
action="#"
|
||||
:auto-upload="false"
|
||||
:show-file-list="false"
|
||||
:on-change="(file) => handleFileSelect(file, 'file')"
|
||||
:before-upload="handleBeforeUpload"
|
||||
>
|
||||
<div v-if="formData.file" class="upload-preview">
|
||||
<span>{{ formData.file.name }}</span>
|
||||
<el-button type="danger" size="small" @click.stop="removeFile('file')">删除</el-button>
|
||||
</div>
|
||||
<el-button v-else size="small" type="primary">点击选择文件</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
const formData = reactive<any>({
|
||||
amount: '',
|
||||
file: undefined
|
||||
})
|
||||
|
||||
const formRules = reactive<any>({
|
||||
amount: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
file: [{ required: true, message: '请选择', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
function handleFileSelect(file: any, field: string): void {
|
||||
// 将文件对象保存到表单数据中
|
||||
formData[field] = file.raw // file.raw 是实际的 File 对象
|
||||
console.log(formData[field])
|
||||
formRef.value.clearValidate(field)
|
||||
ElMessage.success('文件选择成功')
|
||||
}
|
||||
|
||||
function handleBeforeUpload(file: File): boolean {
|
||||
// 可以在这里添加文件类型和大小的校验
|
||||
const isLt10M = file.size / 1024 / 1024 < 10
|
||||
if (!isLt10M) {
|
||||
ElMessage.error('上传文件大小不能超过 10MB!')
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
function removeFile(field: string): void {
|
||||
formData[field] = undefined
|
||||
ElMessage.success('文件已删除')
|
||||
}
|
||||
|
||||
const getForm = () => {
|
||||
return formData
|
||||
}
|
||||
|
||||
const submit = (): Promise<boolean> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
formRef.value?.validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
resolve(true)
|
||||
} else {
|
||||
ElMessage.error('请完善必填信息')
|
||||
reject(false)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
defineExpose({
|
||||
submit,
|
||||
getForm
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pre-registration-form {
|
||||
width: 100%;
|
||||
padding-right: 20px;
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
&::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
}
|
||||
.section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="data-table__toolbar">
|
||||
<div class="data-table__toolbar--actions">
|
||||
<el-button type="success" @click="handleOpenDialog()">新增发票</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
ref="dataTableRef"
|
||||
v-loading="loading"
|
||||
:data="roleList"
|
||||
highlight-current-row
|
||||
class="data-table__content"
|
||||
>
|
||||
<el-table-column label="金额" prop="amount" />
|
||||
<el-table-column label="发票" prop="file">
|
||||
<template #default="{ row }">
|
||||
<el-link
|
||||
v-if="row.file && isValidJson(row.file)"
|
||||
:href="getFileInfo(row.file)?.url"
|
||||
target="_blank"
|
||||
>
|
||||
{{ getFileInfo(row.file)?.name }}
|
||||
</el-link>
|
||||
<span v-else>无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="时间" prop="times" />
|
||||
<el-table-column fixed="right" label="操作" width="140">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" size="small" link @click="handleOpenDialog(scope.row.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button type="danger" size="small" link @click="onUserDeleteDepartment(scope.row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-if="total > 0"
|
||||
v-model:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="fetchData"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getFileInfo, isValidJson } from '@/utils/auxiliaryFunction'
|
||||
import { BusinessInvoicedetail, BusinessUploadinvoice } from '@/api/calibration/caseManagement'
|
||||
import { functionDialogBox } from '@/utils/functionDialogBox'
|
||||
import CaseInvoiceForm from '@/views/calibration/caseManagement/components/CaseInvoiceComponent/components/CaseInvoiceForm.vue'
|
||||
import { UserDeleteDepartment } from '@/api/calibration/department'
|
||||
|
||||
const props = defineProps({
|
||||
preLitigationActionId: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
|
||||
const loading = ref(false)
|
||||
const total = ref(0)
|
||||
// 表格数据
|
||||
const roleList = ref<any[]>()
|
||||
|
||||
const queryParams = reactive<any>({
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
})
|
||||
|
||||
// 获取数据
|
||||
function fetchData() {
|
||||
loading.value = true
|
||||
BusinessInvoicedetail(props.preLitigationActionId)
|
||||
.then((res: any) => {
|
||||
roleList.value = res.data
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 重置查询
|
||||
function handleResetQuery() {
|
||||
queryParams.pageNum = 1
|
||||
fetchData()
|
||||
}
|
||||
|
||||
// 打开弹窗
|
||||
function handleOpenDialog(roleId?: string) {
|
||||
if (roleId) {
|
||||
functionDialogBox(
|
||||
CaseInvoiceForm,
|
||||
{},
|
||||
{
|
||||
title: '编辑发票',
|
||||
width: '500',
|
||||
ok(value: any) {
|
||||
console.log('value', value)
|
||||
}
|
||||
// cancel() {
|
||||
// console.log("value");
|
||||
// },
|
||||
}
|
||||
)
|
||||
} else {
|
||||
functionDialogBox(
|
||||
CaseInvoiceForm,
|
||||
{},
|
||||
{
|
||||
title: '新增发票',
|
||||
width: '500',
|
||||
ok(value: any) {
|
||||
handleSubmit(value)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交表单
|
||||
function handleSubmit(data: any) {
|
||||
loading.value = true
|
||||
const roleId = data.id
|
||||
if (roleId) {
|
||||
// RoleAPI.update(roleId, formData)
|
||||
// .then(() => {
|
||||
// ElMessage.success('修改成功')
|
||||
// handleCloseDialog()
|
||||
// handleResetQuery()
|
||||
// })
|
||||
// .finally(() => (loading.value = false))
|
||||
} else {
|
||||
BusinessUploadinvoice({ ...data, user_id: props.preLitigationActionId })
|
||||
.then(() => {
|
||||
ElMessage.success('新增成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
}
|
||||
}
|
||||
|
||||
// 删除
|
||||
const onUserDeleteDepartment = (id: string) => {
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
UserDeleteDepartment(id)
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
},
|
||||
() => {
|
||||
ElMessage.info('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
onMounted(() => {
|
||||
fetchData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
@@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<div class="pre-registration-form">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="auto"
|
||||
label-position="top"
|
||||
>
|
||||
<el-form-item label="文本" prop="content">
|
||||
<el-input v-model="formData.content" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="代理合同" prop="file">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
action="#"
|
||||
:auto-upload="false"
|
||||
:show-file-list="false"
|
||||
:on-change="(file) => handleFileSelect(file, 'file')"
|
||||
:before-upload="handleBeforeUpload"
|
||||
>
|
||||
<div v-if="formData.file" class="upload-preview">
|
||||
<span>{{ formData.file.name }}</span>
|
||||
<el-button type="danger" size="small" @click.stop="removeFile('file')">删除</el-button>
|
||||
</div>
|
||||
<el-button v-else size="small" type="primary">点击选择文件</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
const formData = reactive<any>({
|
||||
content: '',
|
||||
file: undefined
|
||||
})
|
||||
|
||||
const formRules = reactive<any>({
|
||||
content: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
file: [{ required: true, message: '请选择合同', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
function handleFileSelect(file: any, field: string): void {
|
||||
// 将文件对象保存到表单数据中
|
||||
formData[field] = file.raw // file.raw 是实际的 File 对象
|
||||
console.log(formData[field])
|
||||
formRef.value.clearValidate(field)
|
||||
ElMessage.success('文件选择成功')
|
||||
}
|
||||
|
||||
function handleBeforeUpload(file: File): boolean {
|
||||
// 可以在这里添加文件类型和大小的校验
|
||||
const isLt10M = file.size / 1024 / 1024 < 10
|
||||
if (!isLt10M) {
|
||||
ElMessage.error('上传文件大小不能超过 10MB!')
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
function removeFile(field: string): void {
|
||||
formData[field] = undefined
|
||||
ElMessage.success('文件已删除')
|
||||
}
|
||||
|
||||
const getForm = () => {
|
||||
return formData
|
||||
}
|
||||
|
||||
const submit = (): Promise<boolean> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
formRef.value?.validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
resolve(true)
|
||||
} else {
|
||||
ElMessage.error('请完善必填信息')
|
||||
reject(false)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
defineExpose({
|
||||
submit,
|
||||
getForm
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pre-registration-form {
|
||||
width: 100%;
|
||||
padding-right: 20px;
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
&::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
}
|
||||
.section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="data-table__toolbar">
|
||||
<div class="data-table__toolbar--actions">
|
||||
<el-button type="success" @click="handleOpenDialog()">新增日志</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
ref="dataTableRef"
|
||||
v-loading="loading"
|
||||
:data="roleList"
|
||||
highlight-current-row
|
||||
class="data-table__content"
|
||||
>
|
||||
<el-table-column label="文本" prop="content" />
|
||||
<el-table-column label="代理合同" prop="file">
|
||||
<template #default="{ row }">
|
||||
<el-link
|
||||
v-if="row.file && isValidJson(row.file)"
|
||||
:href="getFileInfo(row.file)?.url"
|
||||
target="_blank"
|
||||
>
|
||||
{{ getFileInfo(row.file)?.name }}
|
||||
</el-link>
|
||||
<span v-else>无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="时间" prop="times" />
|
||||
<el-table-column fixed="right" label="操作" width="140">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" size="small" link @click="handleOpenDialog(scope.row.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button type="danger" size="small" link @click="onUserDeleteDepartment(scope.row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-if="total > 0"
|
||||
v-model:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="fetchData"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getFileInfo, isValidJson } from '@/utils/auxiliaryFunction'
|
||||
import { BusinessLog, BusinessLogdetail } from '@/api/calibration/caseManagement'
|
||||
import { functionDialogBox } from '@/utils/functionDialogBox'
|
||||
import CaseLogForm from '@/views/calibration/caseManagement/components/CaseLogComponent/components/CaseLogForm.vue'
|
||||
import { UserDeleteDepartment } from '@/api/calibration/department'
|
||||
|
||||
const props = defineProps({
|
||||
preLitigationActionId: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
|
||||
const loading = ref(false)
|
||||
const total = ref(0)
|
||||
// 表格数据
|
||||
const roleList = ref<any[]>()
|
||||
|
||||
const queryParams = reactive<any>({
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
})
|
||||
|
||||
// 获取数据
|
||||
function fetchData() {
|
||||
loading.value = true
|
||||
BusinessLogdetail(queryParams)
|
||||
.then((res: any) => {
|
||||
roleList.value = res.data
|
||||
total.value = res.total
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 重置查询
|
||||
function handleResetQuery() {
|
||||
queryParams.pageNum = 1
|
||||
fetchData()
|
||||
}
|
||||
|
||||
// 打开弹窗
|
||||
function handleOpenDialog(roleId?: string) {
|
||||
if (roleId) {
|
||||
functionDialogBox(
|
||||
CaseLogForm,
|
||||
{},
|
||||
{
|
||||
title: '编辑日志',
|
||||
width: '500',
|
||||
ok(value: any) {
|
||||
console.log('value', value)
|
||||
}
|
||||
// cancel() {
|
||||
// console.log("value");
|
||||
// },
|
||||
}
|
||||
)
|
||||
} else {
|
||||
functionDialogBox(
|
||||
CaseLogForm,
|
||||
{},
|
||||
{
|
||||
title: '新增日志',
|
||||
width: '500',
|
||||
ok(value: any) {
|
||||
handleSubmit(value)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交表单
|
||||
function handleSubmit(data: any) {
|
||||
loading.value = true
|
||||
const roleId = data.id
|
||||
if (roleId) {
|
||||
// RoleAPI.update(roleId, formData)
|
||||
// .then(() => {
|
||||
// ElMessage.success('修改成功')
|
||||
// handleCloseDialog()
|
||||
// handleResetQuery()
|
||||
// })
|
||||
// .finally(() => (loading.value = false))
|
||||
} else {
|
||||
BusinessLog({ ...data, user_id: props.preLitigationActionId })
|
||||
.then(() => {
|
||||
ElMessage.success('新增成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
}
|
||||
}
|
||||
|
||||
// 删除
|
||||
const onUserDeleteDepartment = (id: string) => {
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
UserDeleteDepartment(id)
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
},
|
||||
() => {
|
||||
ElMessage.info('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
onMounted(() => {
|
||||
fetchData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
@@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<div class="pre-registration-form">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="auto"
|
||||
label-position="top"
|
||||
>
|
||||
<el-form-item label="预立案" prop="user_id">
|
||||
<el-select v-model="formData.user_id" placeholder="请选择预立案">
|
||||
<el-option
|
||||
v-for="(item, index) in userIdList"
|
||||
:key="index"
|
||||
:label="
|
||||
JSON.parse(item.party_username)
|
||||
.map((item1: any) => item1.name)
|
||||
.join(',')
|
||||
"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="立案时间" prop="times">
|
||||
<el-date-picker
|
||||
v-model="formData.times"
|
||||
type="date"
|
||||
placeholder="请选择立案时间"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="代理合同" prop="AgencyContract">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
action="#"
|
||||
:auto-upload="false"
|
||||
:show-file-list="false"
|
||||
:on-change="(file) => handleFileSelect(file, 'AgencyContract')"
|
||||
:before-upload="handleBeforeUpload"
|
||||
>
|
||||
<div v-if="formData.AgencyContract" class="upload-preview">
|
||||
<span>{{ formData.AgencyContract.name }}</span>
|
||||
<el-button type="danger" size="small" @click.stop="removeFile('AgencyContract')">
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button v-else size="small" type="primary">点击选择文件</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同返还" prop="Contractreturn">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
action="#"
|
||||
:auto-upload="false"
|
||||
:show-file-list="false"
|
||||
:on-change="(file) => handleFileSelect(file, 'Contractreturn')"
|
||||
:before-upload="handleBeforeUpload"
|
||||
>
|
||||
<div v-if="formData.Contractreturn" class="upload-preview">
|
||||
<span>{{ formData.Contractreturn.name }}</span>
|
||||
<el-button type="danger" size="small" @click.stop="removeFile('Contractreturn')">
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button v-else size="small" type="primary">点击选择文件</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="结案申请" prop="Closingapplication">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
action="#"
|
||||
:auto-upload="false"
|
||||
:show-file-list="false"
|
||||
:on-change="(file) => handleFileSelect(file, 'Closingapplication')"
|
||||
:before-upload="handleBeforeUpload"
|
||||
>
|
||||
<div v-if="formData.Closingapplication" class="upload-preview">
|
||||
<span>{{ formData.Closingapplication.name }}</span>
|
||||
<el-button type="danger" size="small" @click.stop="removeFile('Closingapplication')">
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button v-else size="small" type="primary">点击选择文件</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="变更申请" prop="ChangeRequest">
|
||||
<el-input v-model="formData.ChangeRequest" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="已收款" prop="paymentcollection">
|
||||
<el-input v-model="formData.paymentcollection" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="代办审核人" prop="personincharge">
|
||||
<el-select v-model="formData.personincharge" placeholder="请选择代办审核人">
|
||||
<el-option
|
||||
v-for="item in PersoninchargeList"
|
||||
:key="item.id"
|
||||
:label="item.username"
|
||||
:value="item.username"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 提交按钮 -->
|
||||
<!-- <div class="form-actions">-->
|
||||
<!-- <el-button type="primary" @click="handleSubmit">提交</el-button>-->
|
||||
<!-- <el-button @click="handleSaveDraft">暂存</el-button>-->
|
||||
<!-- </div>-->
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { BusinessPreFilingLinkedCases, BusinessRegistrationlist } from "@/api/calibration/preRegistration";
|
||||
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
const formData = reactive<any>({
|
||||
user_id: '',
|
||||
times: '',
|
||||
AgencyContract: undefined,
|
||||
Contractreturn: undefined,
|
||||
Closingapplication: undefined,
|
||||
ChangeRequest: '',
|
||||
paymentcollection: '',
|
||||
personincharge: ''
|
||||
})
|
||||
|
||||
const PersoninchargeList = ref<any[]>([])
|
||||
const userIdList = ref<any[]>([])
|
||||
|
||||
const formRules = reactive<any>({
|
||||
user_id: [{ required: true, message: '请选择预立案', trigger: 'blur' }],
|
||||
times: [{ required: true, message: '请选择预立案日期', trigger: 'change' }],
|
||||
AgencyContract: [{ required: true, message: '请选择合同', trigger: 'blur' }],
|
||||
Contractreturn: [{ required: true, message: '请选择合同', trigger: 'blur' }],
|
||||
Closingapplication: [{ required: true, message: '请选择合同', trigger: 'blur' }],
|
||||
ChangeRequest: [{ required: true, message: '请输入', trigger: 'change' }],
|
||||
paymentcollection: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
personincharge: [{ required: true, message: '请选择审核人', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
function handleFileSelect(file: any, field: string): void {
|
||||
// 将文件对象保存到表单数据中
|
||||
formData[field] = file.raw // file.raw 是实际的 File 对象
|
||||
console.log(formData[field])
|
||||
formRef.value.clearValidate(field)
|
||||
ElMessage.success('文件选择成功')
|
||||
}
|
||||
|
||||
function handleBeforeUpload(file: File): boolean {
|
||||
// 可以在这里添加文件类型和大小的校验
|
||||
const isLt10M = file.size / 1024 / 1024 < 10
|
||||
if (!isLt10M) {
|
||||
ElMessage.error('上传文件大小不能超过 10MB!')
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
function removeFile(field: string): void {
|
||||
formData[field] = undefined
|
||||
ElMessage.success('文件已删除')
|
||||
}
|
||||
|
||||
const DepartmentList = () => {
|
||||
UserPersonneldisplay().then((res: any) => {
|
||||
PersoninchargeList.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
const onBusinessRegistrationlist = () => {
|
||||
BusinessPreFilingLinkedCases().then((res: any) => {
|
||||
userIdList.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
onBusinessRegistrationlist()
|
||||
DepartmentList()
|
||||
})
|
||||
|
||||
const getForm = () => {
|
||||
return formData
|
||||
}
|
||||
|
||||
const submit = (): Promise<boolean> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
formRef.value?.validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
resolve(true)
|
||||
} else {
|
||||
ElMessage.error('请完善必填信息')
|
||||
reject(false)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
defineExpose({
|
||||
submit,
|
||||
getForm
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pre-registration-form {
|
||||
width: 100%;
|
||||
height: 600px;
|
||||
padding-right: 20px;
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
&::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
}
|
||||
.section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<el-form ref="fomrRef" :model="formInline" label-width="auto" :rules="rules">
|
||||
<el-form-item label="已收款" prop="paymentcollection">
|
||||
<el-input v-model="formInline.paymentcollection" placeholder="请输入已收款"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { UserDepartment } from '@/api/calibration/department'
|
||||
|
||||
const fomrRef = ref()
|
||||
const options = ref<any[]>([])
|
||||
const rules = ref({
|
||||
paymentcollection: [{ required: true, message: '请输入', trigger: 'change' }]
|
||||
})
|
||||
|
||||
const DepartmentList = (name: string = '') => {
|
||||
UserDepartment(name).then((res: any) => {
|
||||
options.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
const formInline = reactive({
|
||||
paymentcollection: ''
|
||||
})
|
||||
|
||||
const getForm = () => {
|
||||
return formInline
|
||||
}
|
||||
const submit = () => {
|
||||
return fomrRef.value?.validate()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
submit,
|
||||
getForm
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
DepartmentList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
431
src/views/calibration/caseManagement/index.vue
Normal file
431
src/views/calibration/caseManagement/index.vue
Normal file
@@ -0,0 +1,431 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索区域 -->
|
||||
<div class="search-container">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item prop="type" label="type人">
|
||||
<el-input
|
||||
v-model="queryParams.type"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="times">
|
||||
<el-date-picker
|
||||
v-model="queryParams.times"
|
||||
type="daterange"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择创建时间"
|
||||
range-separator="至"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item class="search-buttons">
|
||||
<el-button type="primary" icon="search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="refresh" @click="handleResetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-card shadow="hover" class="data-table">
|
||||
<div class="data-table__toolbar">
|
||||
<div class="data-table__toolbar--actions">
|
||||
<el-button type="success" icon="plus" @click="handleOpenDialog()">新增</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
:disabled="ids.length === 0"
|
||||
icon="delete"
|
||||
@click="handleDelete()"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
ref="dataTableRef"
|
||||
v-loading="loading"
|
||||
:data="roleList"
|
||||
highlight-current-row
|
||||
border
|
||||
class="data-table__content"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="项目类型" prop="type_pro" />
|
||||
<el-table-column label="代理合同" align="center" prop="AgencyContract">
|
||||
<template #default="{ row }">
|
||||
<el-link
|
||||
v-if="row.AgencyContract && isValidJson(row.AgencyContract)"
|
||||
:href="getFileInfo(row.AgencyContract)?.url"
|
||||
target="_blank"
|
||||
>
|
||||
{{ getFileInfo(row.AgencyContract)?.name }}
|
||||
</el-link>
|
||||
<span v-else>无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合同返还" align="center" prop="Contractreturn">
|
||||
<template #default="{ row }">
|
||||
<el-link
|
||||
v-if="row.Contractreturn && isValidJson(row.Contractreturn)"
|
||||
:href="getFileInfo(row.Contractreturn)?.url"
|
||||
target="_blank"
|
||||
>
|
||||
{{ getFileInfo(row.Contractreturn)?.name }}
|
||||
</el-link>
|
||||
<span v-else>无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结案申请" align="center" prop="Closingapplication">
|
||||
<template #default="{ row }">
|
||||
<el-link
|
||||
v-if="row.Closingapplication && isValidJson(row.Closingapplication)"
|
||||
:href="getFileInfo(row.Closingapplication)?.url"
|
||||
target="_blank"
|
||||
>
|
||||
{{ getFileInfo(row.Closingapplication)?.name }}
|
||||
</el-link>
|
||||
<span v-else>无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变更申请" prop="ChangeRequest" />
|
||||
<el-table-column label="已收款" prop="paymentcollection" />
|
||||
<el-table-column label="委托人信息" prop="client_username">
|
||||
<el-table-column v-slot="{ row }" prop="client_username" label="自然人姓名/法人名称">
|
||||
{{
|
||||
JSON.parse(row.client_username)
|
||||
.map((item: any) => item.name)
|
||||
.join(',')
|
||||
}}
|
||||
</el-table-column>
|
||||
<el-table-column v-slot="{ row }" prop="client_username" label="身份证号码/统一代码">
|
||||
{{
|
||||
JSON.parse(row.client_username)
|
||||
.map((item: any) => item.idNumber)
|
||||
.join(',')
|
||||
}}
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="相对方信息" prop="party_username">
|
||||
<el-table-column v-slot="{ row }" prop="party_username" label="自然人姓名/法人名称">
|
||||
{{
|
||||
JSON.parse(row.party_username)
|
||||
.map((item: any) => item.name)
|
||||
.join(',')
|
||||
}}
|
||||
</el-table-column>
|
||||
<el-table-column v-slot="{ row }" prop="party_username" label="身份证号码/统一代码">
|
||||
{{
|
||||
JSON.parse(row.party_username)
|
||||
.map((item: any) => item.idNumber)
|
||||
.join(',')
|
||||
}}
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="描述" prop="description" />
|
||||
<el-table-column label="状态" prop="state" />
|
||||
<el-table-column label="时间" prop="times" />
|
||||
<el-table-column fixed="right" label="操作" width="310">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="caseLog(scope.row.user_id)"
|
||||
>
|
||||
案件日志
|
||||
</el-button>
|
||||
<el-button type="primary" size="small" link icon="edit" @click="caseInvoice(scope.row)">
|
||||
案件发票
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="accumulatedReceivedPayments(scope.row.user_id)"
|
||||
>
|
||||
累加已收款
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog(scope.row.id)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
link
|
||||
icon="delete"
|
||||
@click="onUserDeleteDepartment(scope.row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-if="total > 0"
|
||||
v-model:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="fetchData"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import RoleAPI, { RolePageVO } from '@/api/system/role-api'
|
||||
import { UserDeleteDepartment } from '@/api/calibration/department'
|
||||
import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { functionDialogBox } from '@/utils/functionDialogBox'
|
||||
import CaseManagementForm from './components/CaseManagementForm.vue'
|
||||
import CaseLogComponent from './components/CaseLogComponent/index.vue'
|
||||
import CaseInvoiceComponent from './components/CaseInvoiceComponent/index.vue'
|
||||
import {
|
||||
BusinessAccumulate,
|
||||
BusinessCasemanagement,
|
||||
BusinessCasemanagementdetail
|
||||
} from '@/api/calibration/caseManagement'
|
||||
import { getFileInfo, isValidJson } from '@/utils/auxiliaryFunction'
|
||||
import CumulativeReceivedPaymentForm from '@/views/calibration/caseManagement/components/CumulativeReceivedPaymentForm.vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'Role',
|
||||
inheritAttrs: false
|
||||
})
|
||||
|
||||
const queryFormRef = ref()
|
||||
const permTreeRef = ref()
|
||||
|
||||
const loading = ref(false)
|
||||
const ids = ref<number[]>([])
|
||||
const total = ref(0)
|
||||
const personinchargeList = ref<any[]>([])
|
||||
|
||||
const queryParams = reactive<any>({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
times: [],
|
||||
type: ''
|
||||
})
|
||||
|
||||
// 表格数据
|
||||
const roleList = ref<RolePageVO[]>()
|
||||
|
||||
// 弹窗
|
||||
const dialog = reactive({
|
||||
title: '',
|
||||
visible: false
|
||||
})
|
||||
|
||||
const permKeywords = ref('')
|
||||
|
||||
// 获取数据
|
||||
function fetchData() {
|
||||
loading.value = true
|
||||
BusinessCasemanagementdetail(queryParams)
|
||||
.then((res: any) => {
|
||||
roleList.value = res.data
|
||||
total.value = res.total
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 查询(重置页码后获取数据)
|
||||
function handleQuery() {
|
||||
queryParams.pageNum = 1
|
||||
fetchData()
|
||||
}
|
||||
|
||||
// 重置查询
|
||||
function handleResetQuery() {
|
||||
if (queryFormRef.value) queryFormRef.value.resetFields()
|
||||
queryParams.pageNum = 1
|
||||
fetchData()
|
||||
}
|
||||
|
||||
// 行复选框选中
|
||||
function handleSelectionChange(selection: any) {
|
||||
ids.value = selection.map((item: any) => item.id)
|
||||
}
|
||||
|
||||
// 打开角色弹窗
|
||||
function handleOpenDialog(roleId?: string) {
|
||||
dialog.visible = true
|
||||
if (roleId) {
|
||||
functionDialogBox(
|
||||
CaseManagementForm,
|
||||
{},
|
||||
{
|
||||
title: '编辑预立案登记',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
console.log('value', value)
|
||||
}
|
||||
// cancel() {
|
||||
// console.log("value");
|
||||
// },
|
||||
}
|
||||
)
|
||||
} else {
|
||||
functionDialogBox(
|
||||
CaseManagementForm,
|
||||
{},
|
||||
{
|
||||
title: '新增案件',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit(value)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const caseLog = (id: string) => {
|
||||
functionDialogBox(
|
||||
CaseLogComponent,
|
||||
{
|
||||
preLitigationActionId: String(id)
|
||||
},
|
||||
{
|
||||
title: '案件日志',
|
||||
width: '900',
|
||||
footerVisible: false,
|
||||
ok(value: any) {
|
||||
console.log('value', value)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
const caseInvoice = (data: any) => {
|
||||
functionDialogBox(
|
||||
CaseInvoiceComponent,
|
||||
{
|
||||
preLitigationActionId: String(data.user_id)
|
||||
},
|
||||
{
|
||||
title: '案件发票',
|
||||
width: '900',
|
||||
footerVisible: false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
const accumulatedReceivedPayments = (id: string) => {
|
||||
functionDialogBox(
|
||||
CumulativeReceivedPaymentForm,
|
||||
{},
|
||||
{
|
||||
title: '累加已收款',
|
||||
width: '500',
|
||||
ok(value: any) {
|
||||
BusinessAccumulate({
|
||||
user_id: id,
|
||||
paymentcollection: value.paymentcollection
|
||||
}).then(() => {
|
||||
ElMessage.success('操作成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// 提交角色表单
|
||||
function handleSubmit(data: any) {
|
||||
loading.value = true
|
||||
const roleId = data.id
|
||||
if (roleId) {
|
||||
// RoleAPI.update(roleId, formData)
|
||||
// .then(() => {
|
||||
// ElMessage.success('修改成功')
|
||||
// handleCloseDialog()
|
||||
// handleResetQuery()
|
||||
// })
|
||||
// .finally(() => (loading.value = false))
|
||||
} else {
|
||||
BusinessCasemanagement(data)
|
||||
.then(() => {
|
||||
ElMessage.success('新增成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
}
|
||||
}
|
||||
|
||||
const onUserDeleteDepartment = (id: string) => {
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
UserDeleteDepartment(id)
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
},
|
||||
() => {
|
||||
ElMessage.info('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
// 删除角色
|
||||
function handleDelete(roleId?: number) {
|
||||
const roleIds = [roleId || ids.value].join(',')
|
||||
if (!roleIds) {
|
||||
ElMessage.warning('请勾选删除项')
|
||||
return
|
||||
}
|
||||
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
RoleAPI.deleteByIds(roleIds)
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
},
|
||||
() => {
|
||||
ElMessage.info('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
const DepartmentList = () => {
|
||||
UserPersonneldisplay().then((res: any) => {
|
||||
personinchargeList.value = res.data
|
||||
})
|
||||
}
|
||||
// 权限筛选
|
||||
watch(permKeywords, (val) => {
|
||||
permTreeRef.value!.filter(val)
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
DepartmentList()
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user