Compare commits
10 Commits
45a7a166c5
...
5edfefd38b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5edfefd38b | ||
|
|
9559bc4702 | ||
|
|
76f196d330 | ||
|
|
26a8594f1e | ||
|
|
b387868800 | ||
|
|
059ef47fdd | ||
|
|
82b5ddf352 | ||
|
|
d642dffc49 | ||
|
|
0493fdebf2 | ||
|
|
c5b3fc166f |
@@ -24,6 +24,25 @@ export const FinanceLoan = (data: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑调账申请
|
||||
export const FinanceEditAccounts = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('times', data.times)
|
||||
formData.append('ContractNo', data.ContractNo)
|
||||
formData.append('CustomerID', data.CustomerID)
|
||||
formData.append('amount', data.amount)
|
||||
formData.append('situation', data.situation)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/finance/editAccounts`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 调账申请展示
|
||||
export const FinanceLoandisplay = (data: any) => {
|
||||
const formData = new FormData()
|
||||
@@ -43,3 +62,17 @@ export const FinanceLoandisplay = (data: any) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除调账申请
|
||||
export const FinanceDeleteAccounts = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/finance/deleteAccounts`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
76
src/api/calibration/announcementManagement/index.ts
Normal file
76
src/api/calibration/announcementManagement/index.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
import request from '@/utils/request'
|
||||
import { isFile } from '@/utils/auxiliaryFunction'
|
||||
const AUTH_BASE_URL = '/api2'
|
||||
|
||||
/*
|
||||
* 公告管理
|
||||
* */
|
||||
|
||||
// 新增公告
|
||||
export const BusinessBulletin = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('title', data.title)
|
||||
formData.append('content', data.content)
|
||||
formData.append('file', data.file)
|
||||
formData.append('state', data.state)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/bulletin`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑公告
|
||||
export const BusinessEditBulletin = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('title', data.title)
|
||||
formData.append('content', data.content)
|
||||
if (isFile(data.file)) formData.append('file', data.file)
|
||||
formData.append('state', data.state)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/editBulletin`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 公告展示
|
||||
export const BusinessBulletindetail = (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('unit', data.unit)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/bulletindetail`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除公告
|
||||
export const BusinessDeleteBulletin = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/deleteBulletin`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
81
src/api/calibration/applicationForSealApproval/index.ts
Normal file
81
src/api/calibration/applicationForSealApproval/index.ts
Normal file
@@ -0,0 +1,81 @@
|
||||
import request from '@/utils/request'
|
||||
import { isFile } from '@/utils/auxiliaryFunction'
|
||||
const AUTH_BASE_URL = '/api2'
|
||||
|
||||
/*
|
||||
* 申请用印
|
||||
* */
|
||||
|
||||
// 新增申请用印
|
||||
export const BusinessApplication = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('Printingpurpose', data.Printingpurpose)
|
||||
formData.append('CaseNumber', data.CaseNumber)
|
||||
formData.append('Reason', data.Reason)
|
||||
formData.append('seal_number', data.seal_number)
|
||||
formData.append('seal_type', data.seal_type)
|
||||
formData.append('file', data.file)
|
||||
formData.append('personincharge', data.personincharge)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/application`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑申请用印
|
||||
export const BusinessEditApplication = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('Printingpurpose', data.Printingpurpose)
|
||||
formData.append('CaseNumber', data.CaseNumber)
|
||||
formData.append('Reason', data.Reason)
|
||||
formData.append('seal_number', data.seal_number)
|
||||
formData.append('seal_type', data.seal_type)
|
||||
if (isFile(data.file)) formData.append('file', data.file)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/editApplication`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 申请用印展示
|
||||
export const BusinessApplicationdetail = (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('seal_type', data.seal_type)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/applicationdetail`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除申请用印
|
||||
export const BusinessDeleteApplication = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/deleteApplication`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import request from '@/utils/request'
|
||||
import { isFile } from '@/utils/auxiliaryFunction'
|
||||
const AUTH_BASE_URL = '/api2'
|
||||
|
||||
/*
|
||||
@@ -24,6 +25,25 @@ export const BusinessBid = (data: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑投标登记
|
||||
export const BusinessEditBid = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('BiddingUnit', data.BiddingUnit)
|
||||
formData.append('ProjectName', data.ProjectName)
|
||||
formData.append('times', data.times)
|
||||
if (isFile(data.BiddingAnnouncement))
|
||||
formData.append('BiddingAnnouncement', data.BiddingAnnouncement)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/editBid`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 投标登记展示
|
||||
export const BusinessBiddetail = (data: any) => {
|
||||
const formData = new FormData()
|
||||
@@ -44,3 +64,17 @@ export const BusinessBiddetail = (data: any) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除投标登记
|
||||
export const BusinessDeleteBid = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/deleteBid`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
159
src/api/calibration/caseManagement/index.ts
Normal file
159
src/api/calibration/caseManagement/index.ts
Normal file
@@ -0,0 +1,159 @@
|
||||
import request from '@/utils/request'
|
||||
import { isFile } from '@/utils/auxiliaryFunction'
|
||||
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 BusinessEditCase = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('times', data.times)
|
||||
if (isFile(data.AgencyContract)) formData.append('AgencyContract', data.AgencyContract)
|
||||
if (isFile(data.Contractreturn)) formData.append('Contractreturn', data.Contractreturn)
|
||||
if (isFile(data.Closingapplication))
|
||||
formData.append('Closingapplication', data.Closingapplication)
|
||||
formData.append('ChangeRequest', data.ChangeRequest)
|
||||
formData.append('paymentcollection', data.paymentcollection)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/editCase`,
|
||||
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 BusinessDeleteCase = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/deleteCase`,
|
||||
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'
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import request from '@/utils/request'
|
||||
import { isFile } from '@/utils/auxiliaryFunction'
|
||||
const AUTH_BASE_URL = '/api2'
|
||||
|
||||
/*
|
||||
@@ -26,6 +27,24 @@ export const BusinessProject = (data: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑立案登记
|
||||
export const BusinessEditproject = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('times', data.times)
|
||||
formData.append('responsiblefor', data.responsiblefor)
|
||||
formData.append('charge', data.charge)
|
||||
if (isFile(data.contract)) formData.append('contract', data.contract)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/editproject`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 立案登记类型查询
|
||||
export const BusinessProjectquerytype = (type: string) => {
|
||||
const formData = new FormData()
|
||||
@@ -60,3 +79,17 @@ export const BusinessProjectdetail = (data: any) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除立项接口
|
||||
export const BusinessDeleteProject = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/deleteProject`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
78
src/api/calibration/inventoryRegistration/index.ts
Normal file
78
src/api/calibration/inventoryRegistration/index.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
import request from '@/utils/request'
|
||||
import { isFile } from "@/utils/auxiliaryFunction";
|
||||
const AUTH_BASE_URL = '/api2'
|
||||
|
||||
/*
|
||||
* 入库登记
|
||||
* */
|
||||
|
||||
// 新增入库登记
|
||||
export const BusinessWarehousing = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('unit', data.unit)
|
||||
formData.append('mark', data.mark)
|
||||
formData.append('lawyer', data.lawyer)
|
||||
formData.append('deadline', data.deadline)
|
||||
formData.append('contract', data.contract)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/warehousing`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑入库登记
|
||||
export const BusinessEditWarehousing = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('unit', data.unit)
|
||||
formData.append('mark', data.mark)
|
||||
formData.append('lawyer', data.lawyer)
|
||||
formData.append('deadline', data.deadline)
|
||||
if (isFile(data.contract)) formData.append('contract', data.contract)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/editWarehousing`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 入库登记 展示
|
||||
export const BusinessWarehousingdetail = (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('unit', data.unit)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/warehousingdetail`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除入库登记
|
||||
export const BusinessDeleteWarehousing = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/deleteWarehousing`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -27,6 +27,29 @@ export const FinanceIssueInvoice = (data: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑开票申请
|
||||
export const FinanceEditInvoice = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('ContractNo', data.ContractNo)
|
||||
formData.append('personincharge', data.personincharge)
|
||||
formData.append('amount', data.amount)
|
||||
formData.append('type', data.type)
|
||||
formData.append('unit', data.unit)
|
||||
formData.append('number', data.number)
|
||||
formData.append('address_telephone', data.address_telephone)
|
||||
formData.append('bank', data.bank)
|
||||
formData.append('username', data.username)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/finance/editInvoice`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 开票分页查询
|
||||
export const FinanceIssueDetail = (data: any) => {
|
||||
const formData = new FormData()
|
||||
@@ -46,3 +69,17 @@ export const FinanceIssueDetail = (data: any) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除开票申请
|
||||
export const FinanceDeleteInvoice = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/finance/deleteInvoice`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
44
src/api/calibration/lawFirmStandardDocuments/index.ts
Normal file
44
src/api/calibration/lawFirmStandardDocuments/index.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
const AUTH_BASE_URL = '/api2'
|
||||
|
||||
/*
|
||||
* 律所标准文件
|
||||
* */
|
||||
|
||||
// 新增律所标准文件
|
||||
export const BusinessLawyerflie = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('title', data.title)
|
||||
formData.append('file', data.file)
|
||||
formData.append('remark', data.remark)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/Lawyerflie`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 律所标准文件展示
|
||||
export const BusinessLawdisplay = () => {
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/lawdisplay`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除律所标准文件
|
||||
export const BusinessLwaDetail = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/LwaDetail`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
89
src/api/calibration/lmportantScheduleManagement/index.ts
Normal file
89
src/api/calibration/lmportantScheduleManagement/index.ts
Normal file
@@ -0,0 +1,89 @@
|
||||
import request from '@/utils/request'
|
||||
const AUTH_BASE_URL = '/api2'
|
||||
|
||||
/*
|
||||
* 重要日程提示
|
||||
* */
|
||||
|
||||
// 新增重要日程提示
|
||||
export const BusinessSchedule = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('title', data.title)
|
||||
if (data.tiems && data.tiems.length) {
|
||||
formData.append('tiems', data.tiems[0])
|
||||
formData.append('end_time', data.tiems[1])
|
||||
}
|
||||
formData.append('remark', data.remark)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/schedule`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑日程
|
||||
export const BusinessEditSchedule = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('title', data.title)
|
||||
if (data.tiems && data.tiems.length) {
|
||||
formData.append('tiems', data.tiems[0])
|
||||
formData.append('end_time', data.tiems[1])
|
||||
}
|
||||
formData.append('remark', data.remark)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/editSchedule`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 日程展示
|
||||
export const BusinessScheduleDetail = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('page', data.pageNum)
|
||||
formData.append('per_page', data.pageSize)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/ScheduleDetail`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除日程
|
||||
export const BusinessDscheduledetail = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/scheduledetail`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 完成代办
|
||||
export const BusinessHandleSchedule = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('state', data.state)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/handleSchedule`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -26,6 +26,27 @@ export const FinancePaymentRequest = (data: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑付款申请
|
||||
export const FinanceEditPayment = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('reason', data.reason)
|
||||
formData.append('amount', data.amount)
|
||||
formData.append('times', data.times)
|
||||
formData.append('payee', data.payee)
|
||||
formData.append('bankcard', data.bankcard)
|
||||
formData.append('BankName', data.BankName)
|
||||
formData.append('applicant', data.applicant)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/finance/editPayment`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 付款申请展示
|
||||
export const FinancePaymentDisplay = (data: any) => {
|
||||
const formData = new FormData()
|
||||
@@ -45,3 +66,17 @@ export const FinancePaymentDisplay = (data: any) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除付款申请
|
||||
export const FinanceDeletePayment = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/finance/deletePayment`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
73
src/api/calibration/permissionManagement/index.ts
Normal file
73
src/api/calibration/permissionManagement/index.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
import request from '@/utils/request'
|
||||
const AUTH_BASE_URL = '/api2'
|
||||
|
||||
/*
|
||||
* 权限管理
|
||||
* */
|
||||
|
||||
// 新增权限
|
||||
export const BusinessAddRermission = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('permission_name', data.permission_name)
|
||||
formData.append('permission_logo', data.permission_logo)
|
||||
formData.append('parent', data.parent)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/addRermission`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑权限
|
||||
export const BusinessEditRermission = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('permission_name', data.permission_name)
|
||||
formData.append('permission_logo', data.permission_logo)
|
||||
formData.append('parent', data.parent)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/editRermission`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 权限展示
|
||||
export const BusinessDisplayRermission = () => {
|
||||
// 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('unit', data.unit)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/displayRermission`,
|
||||
method: 'post'
|
||||
// data: formData,
|
||||
// headers: {
|
||||
// 'Content-Type': 'multipart/form-data'
|
||||
// }
|
||||
})
|
||||
}
|
||||
|
||||
// 删除权限
|
||||
export const BusinessDeleteRermission = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/deleteRermission`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { isFile, isString } from '@/utils/auxiliaryFunction'
|
||||
import { isFile } from '@/utils/auxiliaryFunction'
|
||||
import request from '@/utils/request'
|
||||
const AUTH_BASE_URL = '/api2'
|
||||
|
||||
@@ -31,7 +31,8 @@ export const UserCreateUser = (data: any) => {
|
||||
formData.append('password', data.password)
|
||||
formData.append('nation', data.nation)
|
||||
formData.append('IdCard', data.IdCard)
|
||||
formData.append('department', data.department)
|
||||
formData.append('department', JSON.stringify(data.department))
|
||||
formData.append('role', JSON.stringify(data.role))
|
||||
formData.append('mobilePhone', data.mobilePhone)
|
||||
formData.append('position', data.position)
|
||||
formData.append('team', data.team)
|
||||
@@ -62,7 +63,22 @@ export const UserEditorialStaff = (data: any) => {
|
||||
formData.append('password', data.password)
|
||||
formData.append('nation', data.nation)
|
||||
formData.append('IdCard', data.IdCard)
|
||||
formData.append('department', data.department)
|
||||
// 处理部门数据:如果是数组,转换为JSON字符串
|
||||
if (data.department) {
|
||||
if (Array.isArray(data.department)) {
|
||||
formData.append('department', JSON.stringify(data.department))
|
||||
} else {
|
||||
formData.append('department', data.department)
|
||||
}
|
||||
}
|
||||
// 处理角色数据:如果是数组,转换为JSON字符串
|
||||
if (data.role) {
|
||||
if (Array.isArray(data.role)) {
|
||||
formData.append('role', JSON.stringify(data.role))
|
||||
} else {
|
||||
formData.append('role', data.role)
|
||||
}
|
||||
}
|
||||
formData.append('mobilePhone', data.mobilePhone)
|
||||
formData.append('position', data.position)
|
||||
formData.append('team', data.team)
|
||||
@@ -70,7 +86,6 @@ export const UserEditorialStaff = (data: any) => {
|
||||
formData.append('Confirmationtime', data.Confirmationtime)
|
||||
formData.append('Practicingcertificatetime', data.Practicingcertificatetime)
|
||||
formData.append('academic', JSON.stringify(data.academic))
|
||||
console.log(data.AcademicResume, data.contract, data.ApplicationForm)
|
||||
if (isFile(data.AcademicResume)) formData.append('AcademicResume', data.AcademicResume)
|
||||
if (isFile(data.contract)) formData.append('contract', data.contract)
|
||||
if (isFile(data.ApplicationForm)) formData.append('ApplicationForm', data.ApplicationForm)
|
||||
@@ -91,3 +106,17 @@ export const UserPersonneldisplay = () => {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取角色列表(用于下拉选择)
|
||||
export const getUserRoleOptions = () => {
|
||||
const formData = new FormData()
|
||||
formData.append('RoleName', '')
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/displayRole`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -25,7 +25,28 @@ export const BusinessRegister = (data: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 审批分页接口
|
||||
// 编辑预立案
|
||||
export const BusinessEditRegistration = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('times', data.times)
|
||||
formData.append('client_username', data.client_username)
|
||||
formData.append('client_card', data.client_card)
|
||||
formData.append('party_username', data.party_username)
|
||||
formData.append('party_card', data.party_card)
|
||||
formData.append('description', data.description)
|
||||
formData.append('Undertaker', data.Undertaker)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/editRegistration`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 预立案登记展示
|
||||
export const BusinessRegisterdetail = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('page', data.pageNum)
|
||||
@@ -52,3 +73,25 @@ export const BusinessRegistrationlist = () => {
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 预立案关联立案列表接口
|
||||
export const BusinessPreFilingLinkedCases = () => {
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/preFilingLinkedCases`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除预立案登记接口
|
||||
export const BusinessDeleteRegistration = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/deleteRegistration`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
75
src/api/calibration/registrationPlatform/index.ts
Normal file
75
src/api/calibration/registrationPlatform/index.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
import request from '@/utils/request'
|
||||
const AUTH_BASE_URL = '/api2'
|
||||
|
||||
/*
|
||||
* 注册平台登记
|
||||
* */
|
||||
|
||||
// 新增注册平台登记
|
||||
export const BusinessPlatformRegistration = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('platform', data.platform)
|
||||
formData.append('number', data.number)
|
||||
formData.append('password', data.password)
|
||||
formData.append('username', data.username)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/PlatformRegistration`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 注册平台登记编辑
|
||||
export const BusinessEditPlatform = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('platform', data.platform)
|
||||
formData.append('number', data.number)
|
||||
formData.append('password', data.password)
|
||||
formData.append('username', data.username)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/editPlatform`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 注册平台登记展示
|
||||
export const BusinessPlatformDetail = (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('unit', data.unit)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/PlatformDetail`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 注册平台登记删除
|
||||
export const BusinessDeletePlatform = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/deletePlatform`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -24,6 +24,25 @@ export const FinanceReimbursement = (data: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑报销申请
|
||||
export const FinanceEditReimbursement = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('person', data.person)
|
||||
formData.append('times', data.times)
|
||||
formData.append('reason', data.reason)
|
||||
formData.append('amount', data.amount)
|
||||
formData.append('FeeDescription', data.FeeDescription)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/finance/editReimbursement`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 报销展示
|
||||
export const FinanceReidetail = (data: any) => {
|
||||
const formData = new FormData()
|
||||
@@ -43,3 +62,17 @@ export const FinanceReidetail = (data: any) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除报销申请
|
||||
export const FinanceDeleteReimbursement = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/finance/deleteReimbursement`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -24,6 +24,25 @@ export const FinanceConfirm = (data: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑收入确认
|
||||
export const FinanceEditIncome = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('times', data.times)
|
||||
formData.append('ContractNo', data.ContractNo)
|
||||
formData.append('CustomerID', data.CustomerID)
|
||||
formData.append('amount', data.amount)
|
||||
formData.append('allocate', data.allocate)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/finance/editIncome`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 收入确认展示
|
||||
export const FinanceConfirmdisplay = (data: any) => {
|
||||
const formData = new FormData()
|
||||
@@ -43,3 +62,17 @@ export const FinanceConfirmdisplay = (data: any) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除收入确认
|
||||
export const FinanceDeleteIncome = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/finance/deleteIncome`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
95
src/api/calibration/roleManagement/index.ts
Normal file
95
src/api/calibration/roleManagement/index.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
// roleManagement
|
||||
import request from '@/utils/request'
|
||||
const AUTH_BASE_URL = '/api2'
|
||||
|
||||
/*
|
||||
* 角色管理
|
||||
* */
|
||||
|
||||
// 添加角色
|
||||
export const BusinessAddRole = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('RoleName', data.RoleName)
|
||||
formData.append('remark', data.remark)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/addRole`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑角色
|
||||
export const BusinessEditRole = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('RoleName', data.RoleName)
|
||||
formData.append('remark', data.remark)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/EditRole`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 角色展示
|
||||
export const BusinessDisplayRole = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('RoleName', data.RoleName)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/displayRole`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除角色
|
||||
export const BusinessDeleteRole = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/DeleteRole`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 赋予权限
|
||||
export const BusinessModifypermissions = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('permissionId', JSON.stringify(data.permissionId))
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/modifypermissions`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 根据角色查询权限
|
||||
export const BusinessGetRolePermissions = (roleId: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('roleId', roleId)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/getRolePermissions`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -22,6 +22,23 @@ export const FinanceChange = (data: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑工资/奖金变更
|
||||
export const FinanceEditBonusChange = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('username', data.username)
|
||||
formData.append('type', data.type)
|
||||
formData.append('Instructions', data.Instructions)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/finance/editBonusChange`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 工资/奖金变更展示
|
||||
export const FinanceChangeDetail = (data: any) => {
|
||||
const formData = new FormData()
|
||||
@@ -41,3 +58,17 @@ export const FinanceChangeDetail = (data: any) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除工资/奖金变更
|
||||
export const FinanceDeleteBonusChange = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/finance/deleteBonusChange`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -214,6 +214,16 @@ export default UserAPI
|
||||
|
||||
/** 登录用户信息 */
|
||||
export interface UserInfo {
|
||||
/** 权限数据列表(权限标识数组) */
|
||||
permission_data?: string[]
|
||||
|
||||
/** 角色列表 */
|
||||
role?: Array<{
|
||||
id?: number | string
|
||||
RoleName?: string
|
||||
name?: string
|
||||
permissionId?: string
|
||||
}>
|
||||
/** 用户ID */
|
||||
userId?: string
|
||||
|
||||
|
||||
@@ -78,9 +78,25 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'role',
|
||||
name: 'PersonnelRole',
|
||||
path: 'department',
|
||||
name: 'Department',
|
||||
component: () => import('@/views/calibration/department/index.vue'),
|
||||
meta: {
|
||||
title: '部门管理'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'permissionManagement',
|
||||
name: 'PermissionManagement',
|
||||
component: () => import('@/views/calibration/permissionManagement/index.vue'),
|
||||
meta: {
|
||||
title: '权限管理'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'roleManagement',
|
||||
name: 'RoleManagement',
|
||||
component: () => import('@/views/calibration/roleManagement/index.vue'),
|
||||
meta: {
|
||||
title: '角色管理'
|
||||
}
|
||||
@@ -206,9 +222,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: '案件管理'
|
||||
}
|
||||
@@ -224,12 +240,11 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
title: '申请用印',
|
||||
icon: 'setting'
|
||||
},
|
||||
redirect: '/stamp/index',
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
name: 'StampApplicationIndex',
|
||||
component: () => import('@/views/stamp-application/index.vue'),
|
||||
path: 'applicationForSealApproval',
|
||||
name: 'ApplicationForSealApproval',
|
||||
component: () => import('@/views/calibration/applicationForSealApproval/index.vue'),
|
||||
meta: {
|
||||
title: '申请用印'
|
||||
}
|
||||
@@ -266,18 +281,37 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
title: '入库登记',
|
||||
icon: 'setting'
|
||||
},
|
||||
redirect: '/registration/index',
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
name: 'RegistrationIndex',
|
||||
component: () => import('@/views/registration/index.vue'),
|
||||
path: 'inventoryRegistration',
|
||||
name: 'InventoryRegistration',
|
||||
component: () => import('@/views/calibration/inventoryRegistration/index.vue'),
|
||||
meta: {
|
||||
title: '入库登记'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// 注册平台登记
|
||||
{
|
||||
path: '/filingRegistration',
|
||||
name: 'FilingRegistration',
|
||||
component: Layout,
|
||||
meta: {
|
||||
title: '注册平台登记',
|
||||
icon: 'setting'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'registrationPlatform',
|
||||
name: 'RegistrationPlatform',
|
||||
component: () => import('@/views/calibration/registrationPlatform/index.vue'),
|
||||
meta: {
|
||||
title: '注册平台登记'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// 公告
|
||||
{
|
||||
path: '/notice',
|
||||
@@ -287,12 +321,11 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
title: '公告管理',
|
||||
icon: 'setting'
|
||||
},
|
||||
redirect: '/notice/index',
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
name: 'NoticeIndex',
|
||||
component: () => import('@/views/notice/index.vue'),
|
||||
path: 'announcementManagement',
|
||||
name: 'AnnouncementManagement',
|
||||
component: () => import('@/views/calibration/announcementManagement/index.vue'),
|
||||
meta: {
|
||||
title: '公告管理'
|
||||
}
|
||||
@@ -308,17 +341,35 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
title: '律所标准文件',
|
||||
icon: 'setting'
|
||||
},
|
||||
redirect: '/lawyer-file/index',
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
name: 'LawyerFileIndex',
|
||||
component: () => import('@/views/lawyer/index.vue'),
|
||||
path: 'lawFirmStandardDocuments',
|
||||
name: 'LawFirmStandardDocuments',
|
||||
component: () => import('@/views/calibration/lawFirmStandardDocuments/index.vue'),
|
||||
meta: {
|
||||
title: '律所标准文件'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/lmportantSchedule',
|
||||
name: 'LmportantSchedule',
|
||||
component: Layout,
|
||||
meta: {
|
||||
title: '日程管理',
|
||||
icon: 'setting'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'lmportantScheduleManagement',
|
||||
name: 'LmportantScheduleManagement',
|
||||
component: () => import('@/views/calibration/lmportantScheduleManagement/index.vue'),
|
||||
meta: {
|
||||
title: '日程管理'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@@ -45,10 +45,58 @@ export const AuthStorage = {
|
||||
}
|
||||
|
||||
/**
|
||||
* 权限判断 - 已移除
|
||||
* 权限判断
|
||||
* @param value 需要的权限标识(字符串或字符串数组)
|
||||
* @param type 权限类型:'button' 按钮权限,'role' 角色权限
|
||||
* @returns 是否有权限
|
||||
*/
|
||||
export function hasPerm(value?: string | string[], type?: 'button' | 'role'): boolean {
|
||||
return true
|
||||
// 如果没有传入权限值,默认返回 true(不限制)
|
||||
if (!value) {
|
||||
return true
|
||||
}
|
||||
|
||||
// 获取用户信息
|
||||
const userStore = useUserStoreHook()
|
||||
const userInfo = userStore.userInfo
|
||||
|
||||
// 如果没有用户信息,返回 false
|
||||
if (!userInfo || (!userInfo.id && !userInfo.userId)) {
|
||||
return false
|
||||
}
|
||||
|
||||
// 如果是角色权限检查
|
||||
if (type === 'role') {
|
||||
const userRoles = userInfo.role || []
|
||||
const requiredRoles = Array.isArray(value) ? value : [value]
|
||||
|
||||
// 检查用户是否有任一所需角色
|
||||
return requiredRoles.some((role) => {
|
||||
// 支持角色名称或角色ID匹配
|
||||
return userRoles.some((userRole: any) => {
|
||||
if (typeof userRole === 'string') {
|
||||
return userRole === role
|
||||
}
|
||||
return userRole.RoleName === role || userRole.id === role || userRole.name === role
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 按钮权限检查(默认)
|
||||
// 支持多种字段名:permission_data(后端返回)、perms(标准字段)
|
||||
const userPermissions = (userInfo as any).permission_data || userInfo.perms || []
|
||||
const requiredPerms = Array.isArray(value) ? value : [value]
|
||||
|
||||
// 检查用户是否有任一所需权限
|
||||
// 如果用户没有任何权限数据,返回 false
|
||||
if (userPermissions.length === 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
// 检查是否包含所需权限
|
||||
return requiredPerms.some((perm) => {
|
||||
return userPermissions.includes(perm)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -70,18 +70,53 @@ export function convertFilePathsToObject(filePaths: string | string[]): Array<{
|
||||
}
|
||||
}
|
||||
|
||||
// 分割域名和文件部分
|
||||
const parts = path.split('/')
|
||||
const domain = parts[0] || ''
|
||||
const filePart = parts.slice(1).join('/') || ''
|
||||
// 自动补全协议头
|
||||
let fullPath = path
|
||||
if (!path.startsWith('http://') && !path.startsWith('https://')) {
|
||||
fullPath = `http://${path}`
|
||||
}
|
||||
|
||||
// 分割文件名和UUID
|
||||
const lastUnderscoreIndex = filePart.lastIndexOf('_')
|
||||
const name = lastUnderscoreIndex > 0 ? filePart.substring(0, lastUnderscoreIndex) : filePart
|
||||
const uuid = lastUnderscoreIndex > 0 ? filePart.substring(lastUnderscoreIndex + 1) : ''
|
||||
// 分割域名和文件部分
|
||||
const urlObj = new URL(fullPath)
|
||||
const domain = urlObj.origin
|
||||
const filePart = urlObj.pathname.substring(1) // 移除开头的 /
|
||||
|
||||
// 优化文件名解析逻辑
|
||||
// 对于路径 "cd78824383f7新建 文本文档.txt"
|
||||
// 我们不再强制要求下划线分隔格式,而是提取完整的文件名
|
||||
let name = ''
|
||||
let uuid = ''
|
||||
|
||||
// 尝试从文件名中提取 UUID(假设 UUID 是文件名开头的一段字母数字组合)
|
||||
const uuidMatch = filePart.match(/^([a-f0-9]+)/i)
|
||||
if (uuidMatch && uuidMatch[1]) {
|
||||
uuid = uuidMatch[1]
|
||||
// 文件名是去掉 UUID 后的部分
|
||||
name = filePart.substring(uuid.length)
|
||||
// 如果文件名以斜杠开头则去除
|
||||
if (name.startsWith('/')) {
|
||||
name = name.substring(1)
|
||||
}
|
||||
} else {
|
||||
// 如果没有匹配到 UUID 格式,整个作为文件名处理
|
||||
name = filePart
|
||||
}
|
||||
|
||||
// 如果 name 为空,则使用完整文件部分作为文件名
|
||||
if (!name) {
|
||||
name = filePart
|
||||
}
|
||||
|
||||
// 解码 URL 编码的文件名
|
||||
try {
|
||||
name = decodeURIComponent(name)
|
||||
} catch (e) {
|
||||
// 如果解码失败,保持原始文件名
|
||||
console.warn('文件名解码失败:', name)
|
||||
}
|
||||
|
||||
return {
|
||||
url: path,
|
||||
url: fullPath,
|
||||
domain,
|
||||
name,
|
||||
uuid
|
||||
@@ -92,15 +127,36 @@ export function convertFilePathsToObject(filePaths: string | string[]): Array<{
|
||||
// 安全的文件信息提取函数
|
||||
export function getFileInfo(fileStr: string): { url: string; name: string } | null {
|
||||
try {
|
||||
if (!fileStr || !isValidJson(fileStr)) return null
|
||||
const files = convertFilePathsToObject(JSON.parse(fileStr))
|
||||
return files && files.length > 0 ? files[0] : null
|
||||
if (!fileStr) return null
|
||||
|
||||
// 如果是有效的JSON字符串,按原有逻辑处理
|
||||
if (isValidJson(fileStr)) {
|
||||
const parsed = JSON.parse(fileStr)
|
||||
const files = convertFilePathsToObject(parsed)
|
||||
return files && files.length > 0 ? { url: files[0].url, name: files[0].name } : null
|
||||
}
|
||||
// 如果是URL字符串,直接使用 convertFilePathsToObject 处理
|
||||
else if (typeof fileStr === 'string') {
|
||||
const files = convertFilePathsToObject(fileStr)
|
||||
return files && files.length > 0 ? { url: files[0].url, name: files[0].name } : null
|
||||
}
|
||||
|
||||
return null
|
||||
} catch (e) {
|
||||
console.error('解析文件信息失败:', e)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
export function deepCloneByJSON(obj: any) {
|
||||
try {
|
||||
return JSON.parse(JSON.stringify(obj))
|
||||
} catch (error) {
|
||||
console.error('深拷贝失败:', error)
|
||||
return obj
|
||||
}
|
||||
}
|
||||
|
||||
export function isString(value: any): boolean {
|
||||
return typeof value === 'string'
|
||||
}
|
||||
@@ -116,3 +172,36 @@ export function isValidJson(str: string): boolean {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
export function isValidFormat(data: any): boolean {
|
||||
let parsedData = data
|
||||
|
||||
// 如果输入是字符串,尝试解析为 JSON
|
||||
if (typeof data === 'string') {
|
||||
try {
|
||||
parsedData = JSON.parse(data)
|
||||
} catch (e) {
|
||||
return false // JSON 解析失败,直接返回 false
|
||||
}
|
||||
}
|
||||
|
||||
// 检查是否为数组
|
||||
if (!Array.isArray(parsedData)) {
|
||||
return false
|
||||
}
|
||||
|
||||
// 检查数组中的每个元素
|
||||
return parsedData.every((item) => {
|
||||
// 检查是否为对象且不为 null
|
||||
if (typeof item !== 'object' || item === null) {
|
||||
return false
|
||||
}
|
||||
|
||||
// 检查必需的属性是否存在,且类型是否正确
|
||||
const hasIndex = typeof item.index === 'number'
|
||||
const hasName = typeof item.name === 'string'
|
||||
const hasIdNumber = typeof item.idNumber === 'string'
|
||||
|
||||
return hasIndex && hasName && hasIdNumber
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -21,8 +21,18 @@ const generateRandomToken = () => {
|
||||
/**
|
||||
* 创建 HTTP 请求实例
|
||||
*/
|
||||
// 生产环境直接使用后端地址,开发环境使用代理
|
||||
const getBaseURL = () => {
|
||||
// 如果是生产环境且没有配置 VITE_APP_BASE_API,则使用后端地址
|
||||
if (import.meta.env.PROD && !import.meta.env.VITE_APP_BASE_API) {
|
||||
return 'http://199.168.137.123:8000'
|
||||
}
|
||||
// 开发环境或已配置环境变量,使用环境变量
|
||||
return import.meta.env.VITE_APP_BASE_API || ''
|
||||
}
|
||||
|
||||
const httpRequest = axios.create({
|
||||
baseURL: import.meta.env.VITE_APP_BASE_API,
|
||||
baseURL: getBaseURL(),
|
||||
timeout: 500000,
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
paramsSerializer: (params) => qs.stringify(params)
|
||||
@@ -80,7 +90,7 @@ httpRequest.interceptors.response.use(
|
||||
return Promise.reject(error)
|
||||
}
|
||||
|
||||
const { code, msg } = response.data as ApiResponse
|
||||
const { code, message } = response.data as any
|
||||
|
||||
switch (code) {
|
||||
case ApiCodeEnum.ACCESS_TOKEN_INVALID:
|
||||
@@ -91,17 +101,17 @@ httpRequest.interceptors.response.use(
|
||||
} else {
|
||||
// 未启用token刷新,直接跳转登录页
|
||||
await redirectToLogin('登录已过期,请重新登录')
|
||||
return Promise.reject(new Error(msg || 'Access Token Invalid'))
|
||||
return Promise.reject(new Error(message || 'Access Token Invalid'))
|
||||
}
|
||||
|
||||
case ApiCodeEnum.REFRESH_TOKEN_INVALID:
|
||||
// Refresh Token 过期,跳转登录页
|
||||
await redirectToLogin('登录已过期,请重新登录')
|
||||
return Promise.reject(new Error(msg || 'Refresh Token Invalid'))
|
||||
return Promise.reject(new Error(message || 'Refresh Token Invalid'))
|
||||
|
||||
default:
|
||||
ElMessage.error(msg || '请求失败')
|
||||
return Promise.reject(new Error(msg || 'Request Error'))
|
||||
ElMessage.error(message || '请求失败')
|
||||
return Promise.reject(new Error(message || 'Request Error'))
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
@@ -32,14 +32,6 @@
|
||||
<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
|
||||
@@ -64,7 +56,7 @@
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog(scope.row.id)"
|
||||
@click="handleOpenDialog(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
@@ -118,7 +110,7 @@
|
||||
<el-form-item label="情况" prop="situation">
|
||||
<el-input v-model="formData.situation" placeholder="请输入情况" />
|
||||
</el-form-item>
|
||||
<el-form-item label="代办审核人" prop="personincharge">
|
||||
<el-form-item v-if="!formData?.id" label="代办审核人" prop="personincharge">
|
||||
<el-select v-model="formData.personincharge" placeholder="请选择代办审核人">
|
||||
<el-option
|
||||
v-for="item in personinchargeList"
|
||||
@@ -206,9 +198,14 @@ import { useAppStore } from '@/store/modules/app-store'
|
||||
import { DeviceEnum } from '@/enums/settings/device-enum'
|
||||
|
||||
import RoleAPI, { RolePageVO } from '@/api/system/role-api'
|
||||
import { UserDeleteDepartment } from '@/api/calibration/department'
|
||||
import { FinanceLoan, FinanceLoandisplay } from '@/api/calibration/accountAdjustmentApplication'
|
||||
import {
|
||||
FinanceDeleteAccounts,
|
||||
FinanceEditAccounts,
|
||||
FinanceLoan,
|
||||
FinanceLoandisplay
|
||||
} from '@/api/calibration/accountAdjustmentApplication'
|
||||
import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { deepCloneByJSON } from '@/utils/auxiliaryFunction'
|
||||
|
||||
defineOptions({
|
||||
name: 'Role',
|
||||
@@ -248,6 +245,7 @@ const drawerSize = computed(() => (appStore.device === DeviceEnum.DESKTOP ? '600
|
||||
|
||||
// 角色表单
|
||||
const formData = reactive<any>({
|
||||
id: '',
|
||||
times: '',
|
||||
ContractNo: '',
|
||||
CustomerID: '',
|
||||
@@ -310,15 +308,17 @@ function handleSelectionChange(selection: any) {
|
||||
}
|
||||
|
||||
// 打开角色弹窗
|
||||
function handleOpenDialog(roleId?: string) {
|
||||
function handleOpenDialog(data: any = null) {
|
||||
dialog.visible = true
|
||||
if (roleId) {
|
||||
dialog.title = '修改角色'
|
||||
RoleAPI.getFormData(roleId).then((data) => {
|
||||
Object.assign(formData, data)
|
||||
})
|
||||
if (data) {
|
||||
dialog.title = '修改调帐申请'
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
} else {
|
||||
dialog.title = '新增角色'
|
||||
dialog.title = '新增调帐申请'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ function handleSubmit() {
|
||||
loading.value = true
|
||||
const roleId = formData.id
|
||||
if (roleId) {
|
||||
RoleAPI.update(roleId, formData)
|
||||
FinanceEditAccounts(formData)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleCloseDialog()
|
||||
@@ -369,7 +369,7 @@ const onUserDeleteDepartment = (id: string) => {
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
UserDeleteDepartment(id)
|
||||
FinanceDeleteAccounts(id)
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
handleResetQuery()
|
||||
@@ -381,58 +381,6 @@ const onUserDeleteDepartment = (id: string) => {
|
||||
}
|
||||
)
|
||||
}
|
||||
// 删除角色
|
||||
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('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// 打开分配菜单权限弹窗
|
||||
// async function handleOpenAssignPermDialog(row: RolePageVO) {
|
||||
// const roleId = row.id;
|
||||
// if (roleId) {
|
||||
// assignPermDialogVisible.value = true;
|
||||
// loading.value = true;
|
||||
//
|
||||
// checkedRole.value.id = roleId;
|
||||
// checkedRole.value.name = row.name;
|
||||
//
|
||||
// // 获取所有的菜单
|
||||
// menuPermOptions.value = await MenuAPI.getOptions();
|
||||
//
|
||||
// // 回显角色已拥有的菜单
|
||||
// RoleAPI.getRoleMenuIds(roleId)
|
||||
// .then((data) => {
|
||||
// const checkedMenuIds = data;
|
||||
// checkedMenuIds.forEach((menuId) => permTreeRef.value!.setChecked(menuId, true, false));
|
||||
// })
|
||||
// .finally(() => {
|
||||
// loading.value = false;
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// 分配菜单权限提交
|
||||
function handleAssignPermSubmit() {
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
<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="title">
|
||||
<el-input v-model="formData.title" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="内容" prop="content">
|
||||
<el-input v-model="formData.content" type="textarea" 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-item label="是否置顶" prop="state">
|
||||
<el-select v-model="formData.state" placeholder="请选择">
|
||||
<el-option :label="'置顶'" :value="'1'" />
|
||||
<el-option :label="'不置顶'" :value="'0'" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { convertFilePathsToObject, isValidJson } from '@/utils/auxiliaryFunction'
|
||||
|
||||
const props = defineProps({
|
||||
newData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
const formData = reactive<any>({
|
||||
title: '',
|
||||
content: '',
|
||||
file: undefined,
|
||||
state: '0'
|
||||
})
|
||||
|
||||
const formRules = reactive<any>({
|
||||
title: [{ required: true, message: '请输入', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
function handleFileSelect(file: any, field: string): void {
|
||||
// 将文件对象保存到表单数据中
|
||||
formData[field] = file.raw // file.raw 是实际的 File 对象
|
||||
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('文件已删除')
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
setFormData(props.newData)
|
||||
})
|
||||
|
||||
function deepCloneByJSON(obj: any) {
|
||||
try {
|
||||
return JSON.parse(JSON.stringify(obj))
|
||||
} catch (error) {
|
||||
console.error('深拷贝失败:', error)
|
||||
return obj
|
||||
}
|
||||
}
|
||||
|
||||
const setFormData = (data: any) => {
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
if (data1.file && isValidJson(data1.file)) {
|
||||
data1.file = convertFilePathsToObject(JSON.parse(data1.file))[0]
|
||||
} else {
|
||||
data1.file = undefined
|
||||
}
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
}
|
||||
|
||||
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>
|
||||
289
src/views/calibration/announcementManagement/index.vue
Normal file
289
src/views/calibration/announcementManagement/index.vue
Normal file
@@ -0,0 +1,289 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索区域 -->
|
||||
<!-- <div class="search-container">-->
|
||||
<!-- <el-form ref="queryFormRef" :model="queryParams" :inline="true">-->
|
||||
<!-- <el-form-item prop="unit" label="单位">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.unit"-->
|
||||
<!-- 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="title" />
|
||||
<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="state" />
|
||||
<el-table-column label="时间" prop="times" />
|
||||
<el-table-column fixed="right" label="操作" width="140">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</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 { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { functionDialogBox } from '@/utils/functionDialogBox'
|
||||
import AnnouncementForm from './components/AnnouncementForm.vue'
|
||||
import {
|
||||
BusinessBulletin,
|
||||
BusinessBulletindetail,
|
||||
BusinessDeleteBulletin,
|
||||
BusinessEditBulletin
|
||||
} from '@/api/calibration/announcementManagement'
|
||||
import { getFileInfo, isValidJson } from '@/utils/auxiliaryFunction'
|
||||
|
||||
defineOptions({
|
||||
name: 'Role',
|
||||
inheritAttrs: false
|
||||
})
|
||||
|
||||
const queryFormRef = 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: [],
|
||||
// unit: ''
|
||||
})
|
||||
|
||||
// 表格数据
|
||||
const roleList = ref<RolePageVO[]>()
|
||||
|
||||
// 弹窗
|
||||
const dialog = reactive({
|
||||
title: '',
|
||||
visible: false
|
||||
})
|
||||
|
||||
// 获取数据
|
||||
function fetchData() {
|
||||
loading.value = true
|
||||
BusinessBulletindetail(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(data?: any) {
|
||||
dialog.visible = true
|
||||
if (data?.id) {
|
||||
functionDialogBox(
|
||||
AnnouncementForm,
|
||||
{
|
||||
newData: data
|
||||
},
|
||||
{
|
||||
title: '编辑注册平台登记',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit({ ...value, id: data?.id })
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
functionDialogBox(
|
||||
AnnouncementForm,
|
||||
{},
|
||||
{
|
||||
title: '新增注册平台登记',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit(value)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交角色表单
|
||||
function handleSubmit(data: any) {
|
||||
loading.value = true
|
||||
const roleId = data.id
|
||||
if (roleId) {
|
||||
BusinessEditBulletin(data)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
} else {
|
||||
BusinessBulletin(data)
|
||||
.then(() => {
|
||||
ElMessage.success('新增成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
}
|
||||
}
|
||||
|
||||
const onUserDeleteDepartment = (id: string) => {
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
BusinessDeleteBulletin(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
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
DepartmentList()
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,217 @@
|
||||
<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="Printingpurpose">
|
||||
<el-select v-model="formData.Printingpurpose" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="(item, index) in PrintingpurposeList"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="案件编号" prop="CaseNumber">
|
||||
<el-input v-model="formData.CaseNumber" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用印事由" prop="Reason">
|
||||
<el-input v-model="formData.Reason" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="盖章份数" prop="seal_number">
|
||||
<el-input v-model="formData.seal_number" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="盖着类型" prop="seal_type">
|
||||
<el-select v-model="formData.seal_type" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="(item, index) in seal_typeList"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</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-item v-if="!newData?.id" 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>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { deepCloneByJSON, getFileInfo } from '@/utils/auxiliaryFunction'
|
||||
|
||||
const props = defineProps({
|
||||
newData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
const formData = reactive<any>({
|
||||
Printingpurpose: '',
|
||||
CaseNumber: '',
|
||||
Reason: '',
|
||||
seal_number: '',
|
||||
seal_type: '',
|
||||
file: undefined,
|
||||
personincharge: ''
|
||||
})
|
||||
|
||||
const PersoninchargeList = ref<any[]>([])
|
||||
const PrintingpurposeList = ref<any[]>([
|
||||
{ name: '律师函', value: '律师函' },
|
||||
{ name: '法律服务协议', value: '法律服务协议' },
|
||||
{ name: '所函', value: '所函' },
|
||||
{ name: '介绍信', value: '介绍信' },
|
||||
{ name: '法律意见书', value: '法律意见书' },
|
||||
{ name: '致函件', value: '致函件' },
|
||||
{ name: '投标文件', value: '投标文件' },
|
||||
{ name: '其他文件', value: '其他文件' },
|
||||
{ name: '授权委托书', value: '授权委托书' },
|
||||
{ name: '三方转承协议', value: '三方转承协议' },
|
||||
{ name: '工作报告', value: '工作报告' },
|
||||
{ name: '尽调报告', value: '尽调报告' },
|
||||
{ name: '非业务类用章', value: '非业务类用章' }
|
||||
])
|
||||
const seal_typeList = ref<any[]>([
|
||||
{ name: '公章', value: '公章' },
|
||||
{ name: '合同章', value: '合同章' },
|
||||
{ name: '电子公章', value: '电子公章' }
|
||||
])
|
||||
|
||||
const formRules = reactive<any>({
|
||||
Printingpurpose: [{ required: true, message: '请选择', trigger: 'blur' }],
|
||||
CaseNumber: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
Reason: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
seal_number: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
seal_type: [{ required: true, message: '请选择', trigger: 'blur' }],
|
||||
file: [{ 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 对象
|
||||
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
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
DepartmentList()
|
||||
setFormData(props.newData)
|
||||
})
|
||||
|
||||
const getForm = () => {
|
||||
return formData
|
||||
}
|
||||
|
||||
const setFormData = (data: any) => {
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
data1.file = getFileInfo(data1.file)
|
||||
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
}
|
||||
|
||||
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>
|
||||
289
src/views/calibration/applicationForSealApproval/index.vue
Normal file
289
src/views/calibration/applicationForSealApproval/index.vue
Normal file
@@ -0,0 +1,289 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索区域 -->
|
||||
<div class="search-container">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item prop="seal_type" label="用印用途">
|
||||
<el-input
|
||||
v-model="queryParams.seal_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="Printingpurpose" />
|
||||
<el-table-column label="案件编号" prop="CaseNumber" />
|
||||
<el-table-column label="用印事由" prop="Reason" />
|
||||
<el-table-column label="盖章份数" prop="seal_number" />
|
||||
<el-table-column label="盖着类型" prop="seal_type" />
|
||||
<el-table-column label="用印文件" prop="file">
|
||||
<template #default="{ row }">
|
||||
<el-link v-if="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="state" />
|
||||
<el-table-column label="时间" prop="times" />
|
||||
<el-table-column fixed="right" label="操作" width="140">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</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 { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { functionDialogBox } from '@/utils/functionDialogBox'
|
||||
import StampingForm from './components/StampingForm.vue'
|
||||
|
||||
import { getFileInfo } from '@/utils/auxiliaryFunction'
|
||||
import {
|
||||
BusinessApplication,
|
||||
BusinessApplicationdetail,
|
||||
BusinessDeleteApplication,
|
||||
BusinessEditApplication
|
||||
} from '@/api/calibration/applicationForSealApproval'
|
||||
|
||||
defineOptions({
|
||||
name: 'Role',
|
||||
inheritAttrs: false
|
||||
})
|
||||
|
||||
const queryFormRef = 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: [],
|
||||
seal_type: ''
|
||||
})
|
||||
|
||||
// 表格数据
|
||||
const roleList = ref<RolePageVO[]>()
|
||||
|
||||
// 弹窗
|
||||
const dialog = reactive({
|
||||
title: '',
|
||||
visible: false
|
||||
})
|
||||
|
||||
// 获取数据
|
||||
function fetchData() {
|
||||
loading.value = true
|
||||
BusinessApplicationdetail(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(data: any = null) {
|
||||
dialog.visible = true
|
||||
if (data) {
|
||||
functionDialogBox(
|
||||
StampingForm,
|
||||
{
|
||||
newData: data
|
||||
},
|
||||
{
|
||||
title: '编辑申请用印',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit({ id: data.id, ...value })
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
functionDialogBox(
|
||||
StampingForm,
|
||||
{},
|
||||
{
|
||||
title: '新增申请用印',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit(value)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交角色表单
|
||||
function handleSubmit(data: any) {
|
||||
loading.value = true
|
||||
const roleId = data.id
|
||||
if (roleId) {
|
||||
BusinessEditApplication(data)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
} else {
|
||||
BusinessApplication(data)
|
||||
.then(() => {
|
||||
ElMessage.success('新增成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
}
|
||||
}
|
||||
|
||||
const onUserDeleteDepartment = (id: string) => {
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
BusinessDeleteApplication(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
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
DepartmentList()
|
||||
})
|
||||
</script>
|
||||
@@ -7,7 +7,7 @@
|
||||
label-width="auto"
|
||||
label-position="top"
|
||||
>
|
||||
<el-form-item label="预立案" prop="user_id">
|
||||
<el-form-item v-if="!newData?.id" label="预立案" prop="user_id">
|
||||
<el-select v-model="formData.user_id" placeholder="请选择预立案">
|
||||
<el-option
|
||||
v-for="(item, index) in userIdList"
|
||||
@@ -101,7 +101,7 @@
|
||||
<el-button v-else size="small" type="primary">点击选择文件</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="代办负责人" prop="personincharge">
|
||||
<el-form-item v-if="!newData?.id" label="代办负责人" prop="personincharge">
|
||||
<el-select v-model="formData.personincharge" placeholder="请选择代办负责人">
|
||||
<el-option
|
||||
v-for="item in UndertakerList"
|
||||
@@ -125,6 +125,14 @@ import { Plus } from '@element-plus/icons-vue'
|
||||
import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { BusinessRegistrationlist } from '@/api/calibration/preRegistration'
|
||||
import { deepCloneByJSON, getFileInfo, isValidFormat } from '@/utils/auxiliaryFunction'
|
||||
|
||||
const props = defineProps({
|
||||
newData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
@@ -221,12 +229,26 @@ const onBusinessRegistrationlist = () => {
|
||||
onMounted(() => {
|
||||
onBusinessRegistrationlist()
|
||||
DepartmentList()
|
||||
setFormData(props.newData)
|
||||
})
|
||||
|
||||
const getForm = () => {
|
||||
return formData
|
||||
}
|
||||
|
||||
const setFormData = (data: any) => {
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
if (isValidFormat(data1.BiddingUnit)) {
|
||||
data1.BiddingUnit = JSON.parse(data1.BiddingUnit)
|
||||
} else {
|
||||
data1.BiddingUnit = []
|
||||
}
|
||||
data1.BiddingAnnouncement = getFileInfo(data1.BiddingAnnouncement)
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
}
|
||||
|
||||
const submit = (): Promise<boolean> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
formRef.value?.validate((valid: boolean) => {
|
||||
@@ -254,7 +276,6 @@ defineExpose({
|
||||
<style scoped lang="scss">
|
||||
.pre-registration-form {
|
||||
width: 100%;
|
||||
height: 600px;
|
||||
padding-right: 20px;
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
label-width="auto"
|
||||
label-position="top"
|
||||
>
|
||||
<el-form-item label="预立案" prop="user_id">
|
||||
<el-form-item v-if="!data?.user_id" label="预立案" prop="user_id">
|
||||
<el-select v-model="formData.user_id" placeholder="请选择预立案">
|
||||
<el-option
|
||||
v-for="(item, index) in userIdList"
|
||||
@@ -21,7 +21,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目类型" prop="type">
|
||||
<el-form-item v-if="!data?.user_id" label="项目类型" prop="type">
|
||||
<el-select v-model="formData.type" placeholder="请选择项目类型" @change="typeChange">
|
||||
<el-option
|
||||
v-for="(item, index) in typeList"
|
||||
@@ -31,7 +31,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同编号" prop="ContractNo">
|
||||
<el-form-item v-if="!data?.user_id" label="合同编号" prop="ContractNo">
|
||||
<el-input v-model="formData.ContractNo" disabled placeholder="选择项目类型生成" />
|
||||
</el-form-item>
|
||||
<el-form-item label="立项日期时间" prop="times">
|
||||
@@ -57,15 +57,6 @@
|
||||
<el-form-item label="收费情况" prop="charge">
|
||||
<el-input v-model="formData.charge" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input
|
||||
v-model="formData.description"
|
||||
type="textarea"
|
||||
placeholder="描述"
|
||||
:rows="4"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="合同" prop="contract">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
@@ -76,7 +67,7 @@
|
||||
:before-upload="handleBeforeUpload"
|
||||
>
|
||||
<div v-if="formData.contract" class="upload-preview">
|
||||
<span>{{ formData.contract.name }}</span>
|
||||
<span>{{ formData.contract?.name }}</span>
|
||||
<el-button type="danger" size="small" @click.stop="removeFile('contract')">
|
||||
删除
|
||||
</el-button>
|
||||
@@ -84,11 +75,16 @@
|
||||
<el-button v-else size="small" type="primary">点击选择文件</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<!-- 提交按钮 -->
|
||||
<!-- <div class="form-actions">-->
|
||||
<!-- <el-button type="primary" @click="handleSubmit">提交</el-button>-->
|
||||
<!-- <el-button @click="handleSaveDraft">暂存</el-button>-->
|
||||
<!-- </div>-->
|
||||
<el-form-item v-if="!data?.user_id" label="代办负责人" prop="personincharge">
|
||||
<el-select v-model="formData.personincharge" placeholder="请选择代办负责人">
|
||||
<el-option
|
||||
v-for="item in UndertakerList"
|
||||
:key="item.id"
|
||||
:label="item.username"
|
||||
:value="item.username"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
@@ -98,6 +94,14 @@ import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { BusinessProjectquerytype } from '@/api/calibration/conflictOfInterestSearch'
|
||||
import { BusinessRegistrationlist } from '@/api/calibration/preRegistration'
|
||||
import { deepCloneByJSON, getFileInfo } from '@/utils/auxiliaryFunction'
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const typeList = [
|
||||
{ name: '法律顾问', value: '顾' },
|
||||
@@ -129,7 +133,6 @@ const formRules = reactive<any>({
|
||||
type: [{ required: true, message: '请选择预立案日期', trigger: 'change' }],
|
||||
ContractNo: [{ required: true, message: '请输入', trigger: 'change' }],
|
||||
times: [{ required: true, message: '请选择预立案日期', trigger: 'change' }],
|
||||
description: [{ required: true, message: '请填写项目简述/案由', trigger: 'blur' }],
|
||||
responsiblefor: [{ required: true, message: '请选择负责人', trigger: 'change' }],
|
||||
charge: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
contract: [{ required: true, message: '请选择合同', trigger: 'blur' }],
|
||||
@@ -140,7 +143,6 @@ const formRules = reactive<any>({
|
||||
function handleFileSelect(file: any, field: string): void {
|
||||
// 将文件对象保存到表单数据中
|
||||
formData[field] = file.raw // file.raw 是实际的 File 对象
|
||||
console.log(formData[field])
|
||||
formRef.value.clearValidate(field)
|
||||
ElMessage.success('文件选择成功')
|
||||
}
|
||||
@@ -190,12 +192,22 @@ const onBusinessRegistrationlist = () => {
|
||||
onMounted(() => {
|
||||
onBusinessRegistrationlist()
|
||||
DepartmentList()
|
||||
setFormData(props.data)
|
||||
})
|
||||
|
||||
const getForm = () => {
|
||||
return formData
|
||||
}
|
||||
|
||||
const setFormData = (data: any) => {
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
data1.contract = getFileInfo(data1.contract)
|
||||
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
}
|
||||
|
||||
const submit = (): Promise<boolean> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
formRef.value?.validate((valid: boolean) => {
|
||||
@@ -217,7 +229,6 @@ defineExpose({
|
||||
<style scoped lang="scss">
|
||||
.pre-registration-form {
|
||||
width: 100%;
|
||||
height: 600px;
|
||||
padding-right: 20px;
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="app-container">
|
||||
<!-- 搜索区域 -->
|
||||
<div class="search-container">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="auto">
|
||||
<el-form ref="queryFormRef" :model="searchs" :inline="true" label-width="auto">
|
||||
<el-form-item label="委托人信息" prop="client_username">
|
||||
<el-input
|
||||
v-model="searchs.client_username"
|
||||
@@ -41,18 +41,53 @@
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column label="预立案" prop="user_id" />
|
||||
<el-table-column label="委托人信息" align="center" prop="client_username">
|
||||
<el-table-column v-slot="{ row }" prop="client_username" label="自然人姓名/法人名称">
|
||||
{{
|
||||
isValidFormat(row.client_username)
|
||||
? JSON.parse(row.client_username)
|
||||
.map((item: any) => item.name)
|
||||
.join(',')
|
||||
: '异常'
|
||||
}}
|
||||
</el-table-column>
|
||||
<el-table-column v-slot="{ row }" prop="client_username" label="身份证号码/统一代码">
|
||||
{{
|
||||
isValidFormat(row.client_username)
|
||||
? JSON.parse(row.client_username)
|
||||
.map((item: any) => item.idNumber)
|
||||
.join(',')
|
||||
: '异常'
|
||||
}}
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="相对方信息" align="center" prop="party_username">
|
||||
<el-table-column v-slot="{ row }" prop="party_username" label="自然人姓名/法人名称">
|
||||
{{
|
||||
isValidFormat(row.party_username)
|
||||
? JSON.parse(row.party_username)
|
||||
.map((item: any) => item.name)
|
||||
.join(',')
|
||||
: '异常'
|
||||
}}
|
||||
</el-table-column>
|
||||
<el-table-column v-slot="{ row }" prop="party_username" label="身份证号码/统一代码">
|
||||
{{
|
||||
isValidFormat(row.party_username)
|
||||
? 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" />
|
||||
<el-table-column label="收费情况" align="center" prop="charge" />
|
||||
<el-table-column label="合同" align="center" prop="contract">
|
||||
<template #default="{ row }">
|
||||
<el-link
|
||||
v-if="row.contract && isValidJson(row.contract)"
|
||||
:href="getFileInfo(row.contract)?.url"
|
||||
target="_blank"
|
||||
>
|
||||
<el-link v-if="row.contract" :href="getFileInfo(row.contract)?.url" target="_blank">
|
||||
{{ getFileInfo(row.contract)?.name }}
|
||||
</el-link>
|
||||
<span v-else>无</span>
|
||||
@@ -66,10 +101,19 @@
|
||||
icon="edit"
|
||||
size="small"
|
||||
link
|
||||
@click="handleResetPassword(scope.row)"
|
||||
@click="handleOpenDialog(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
link
|
||||
icon="delete"
|
||||
@click="onUserDeleteDepartment(scope.row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -96,25 +140,79 @@
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column label="预立案" prop="user_id" />
|
||||
<el-table-column label="委托人信息" align="center" prop="client_username">
|
||||
<el-table-column v-slot="{ row }" prop="client_username" label="自然人姓名/法人名称">
|
||||
{{
|
||||
isValidFormat(row.client_username)
|
||||
? JSON.parse(row.client_username)
|
||||
.map((item: any) => item.name)
|
||||
.join(',')
|
||||
: '异常'
|
||||
}}
|
||||
</el-table-column>
|
||||
<el-table-column v-slot="{ row }" prop="client_username" label="身份证号码/统一代码">
|
||||
{{
|
||||
isValidFormat(row.client_username)
|
||||
? JSON.parse(row.client_username)
|
||||
.map((item: any) => item.idNumber)
|
||||
.join(',')
|
||||
: '异常'
|
||||
}}
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="相对方信息" align="center" prop="party_username">
|
||||
<el-table-column v-slot="{ row }" prop="party_username" label="自然人姓名/法人名称">
|
||||
{{
|
||||
isValidFormat(row.party_username)
|
||||
? JSON.parse(row.party_username)
|
||||
.map((item: any) => item.name)
|
||||
.join(',')
|
||||
: '异常'
|
||||
}}
|
||||
</el-table-column>
|
||||
<el-table-column v-slot="{ row }" prop="party_username" label="身份证号码/统一代码">
|
||||
{{
|
||||
isValidFormat(row.party_username)
|
||||
? 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="自然人姓名/法人名称">
|
||||
{{
|
||||
JSON.parse(row.BiddingUnit)
|
||||
.map((item: any) => item.name)
|
||||
.join(',')
|
||||
isValidFormat(row.BiddingUnit)
|
||||
? JSON.parse(row.BiddingUnit)
|
||||
.map((item: any) => item.name)
|
||||
.join(',')
|
||||
: '异常'
|
||||
}}
|
||||
</el-table-column>
|
||||
<el-table-column v-slot="{ row }" prop="BiddingUnit" label="身份证号码/统一代码">
|
||||
{{
|
||||
JSON.parse(row.BiddingUnit)
|
||||
.map((item: any) => item.idNumber)
|
||||
.join(',')
|
||||
isValidFormat(row.BiddingUnit)
|
||||
? JSON.parse(row.BiddingUnit)
|
||||
.map((item: any) => item.idNumber)
|
||||
.join(',')
|
||||
: '异常'
|
||||
}}
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目名称" align="center" prop="ProjectName" />
|
||||
<el-table-column label="上传招标公告" align="center" prop="BiddingAnnouncement" />
|
||||
<el-table-column label="上传招标公告" align="center" prop="BiddingAnnouncement">
|
||||
<template #default="{ row }">
|
||||
<el-link
|
||||
v-if="row.BiddingAnnouncement"
|
||||
:href="getFileInfo(row.BiddingAnnouncement)?.url"
|
||||
target="_blank"
|
||||
>
|
||||
{{ getFileInfo(row.BiddingAnnouncement)?.name }}
|
||||
</el-link>
|
||||
<span v-else>无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请日期" align="center" prop="times" />
|
||||
<el-table-column label="操作" align="center" width="220">
|
||||
<template #default="scope">
|
||||
@@ -123,10 +221,19 @@
|
||||
icon="edit"
|
||||
size="small"
|
||||
link
|
||||
@click="handleResetPassword(scope.row)"
|
||||
@click="handleOpenDialog2(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
link
|
||||
icon="delete"
|
||||
@click="onUserDeleteDepartment2(scope.row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -151,17 +258,25 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
|
||||
// ==================== 3. 类型定义 ====================
|
||||
import type { UserPageVO } from '@/api/system/user-api'
|
||||
// ==================== 4. API 服务 ====================
|
||||
import UserAPI from '@/api/system/user-api'
|
||||
|
||||
// ==================== 7. Composables ====================
|
||||
import { useTableSelection } from '@/composables'
|
||||
import { functionDialogBox } from '@/utils/functionDialogBox'
|
||||
import BusinessProjectForm from './components/BusinessProjectForm.vue'
|
||||
import { BusinessProject, BusinessProjectdetail } from '@/api/calibration/conflictOfInterestSearch'
|
||||
import {
|
||||
BusinessDeleteProject,
|
||||
BusinessEditproject,
|
||||
BusinessProject,
|
||||
BusinessProjectdetail
|
||||
} from '@/api/calibration/conflictOfInterestSearch'
|
||||
import BidRegistrationForm from './components/BidRegistrationForm.vue'
|
||||
import { BusinessBid, BusinessBiddetail } from '@/api/calibration/bidRegistration'
|
||||
import { getFileInfo, isValidJson } from '@/utils/auxiliaryFunction'
|
||||
import {
|
||||
BusinessBid,
|
||||
BusinessBiddetail,
|
||||
BusinessDeleteBid,
|
||||
BusinessEditBid
|
||||
} from '@/api/calibration/bidRegistration'
|
||||
import { getFileInfo, isValidFormat } from '@/utils/auxiliaryFunction'
|
||||
|
||||
// ==================== 组件配置 ====================
|
||||
defineOptions({
|
||||
@@ -236,8 +351,8 @@ const { handleSelectionChange } = useTableSelection<UserPageVO>()
|
||||
function handleQuery(biaoshi: string = '1'): Promise<void> {
|
||||
queryParams.pageNum = 1
|
||||
queryParams2.pageNum = 1
|
||||
if (biaoshi == '1' || biaoshi == '2') fetchUserList2()
|
||||
if (biaoshi == '1' || biaoshi == '3') fetchUserList()
|
||||
if (biaoshi == '1' || biaoshi == '2') fetchUserList()
|
||||
if (biaoshi == '1' || biaoshi == '3') fetchUserList2()
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
||||
@@ -250,105 +365,65 @@ function handleResetQuery(biaoshi: string = '1'): void {
|
||||
queryParams.createTime = undefined
|
||||
handleQuery(biaoshi)
|
||||
}
|
||||
// ==================== 用户操作 ====================
|
||||
|
||||
/**
|
||||
* 重置用户密码
|
||||
* @param row 用户数据
|
||||
*/
|
||||
function handleResetPassword(row: UserPageVO): void {
|
||||
ElMessageBox.prompt(`请输入用户【${row.username}】的新密码`, '重置密码', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
inputPattern: /.{6,}/,
|
||||
inputErrorMessage: '密码至少需要6位字符'
|
||||
})
|
||||
.then(({ value }) => {
|
||||
return UserAPI.resetPassword(row.id, value)
|
||||
})
|
||||
.then(() => {
|
||||
ElMessage.success('密码重置成功')
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error !== 'cancel') {
|
||||
ElMessage.error('密码重置失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
// ==================== 弹窗操作 ====================
|
||||
async function handleOpenDialog(): Promise<void> {
|
||||
// dialog.visible = true
|
||||
// dialog.title = titleString
|
||||
//
|
||||
// // 并行加载下拉选项数据
|
||||
// try {
|
||||
// ;[roleOptions.value, deptOptions.value] = await Promise.all([
|
||||
// RoleAPI.getOptions(),
|
||||
// DeptAPI.getOptions()
|
||||
// ])
|
||||
// } catch (error) {
|
||||
// ElMessage.error('加载选项数据失败')
|
||||
// console.error('加载选项数据失败:', error)
|
||||
// }
|
||||
//
|
||||
// // 编辑:加载用户数据
|
||||
// if (id) {
|
||||
// try {
|
||||
// const data = await UserAPI.getFormData(id)
|
||||
// Object.assign(formData, data)
|
||||
// } catch (error) {
|
||||
// ElMessage.error('加载用户数据失败')
|
||||
// console.error('加载用户数据失败:', error)
|
||||
// }
|
||||
// }
|
||||
functionDialogBox(
|
||||
BusinessProjectForm,
|
||||
{},
|
||||
{
|
||||
title: '新增立案登记',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit(value)
|
||||
function handleOpenDialog(data: any = null) {
|
||||
if (data) {
|
||||
functionDialogBox(
|
||||
BusinessProjectForm,
|
||||
{
|
||||
data
|
||||
},
|
||||
{
|
||||
title: '编辑立案登记',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit({ id: data.id, ...value })
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
} else {
|
||||
functionDialogBox(
|
||||
BusinessProjectForm,
|
||||
{},
|
||||
{
|
||||
title: '新增立案登记',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit(value)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
async function handleOpenDialog2(): Promise<void> {
|
||||
// dialog.visible = true
|
||||
// dialog.title = titleString
|
||||
//
|
||||
// // 并行加载下拉选项数据
|
||||
// try {
|
||||
// ;[roleOptions.value, deptOptions.value] = await Promise.all([
|
||||
// RoleAPI.getOptions(),
|
||||
// DeptAPI.getOptions()
|
||||
// ])
|
||||
// } catch (error) {
|
||||
// ElMessage.error('加载选项数据失败')
|
||||
// console.error('加载选项数据失败:', error)
|
||||
// }
|
||||
//
|
||||
// // 编辑:加载用户数据
|
||||
// if (id) {
|
||||
// try {
|
||||
// const data = await UserAPI.getFormData(id)
|
||||
// Object.assign(formData, data)
|
||||
// } catch (error) {
|
||||
// ElMessage.error('加载用户数据失败')
|
||||
// console.error('加载用户数据失败:', error)
|
||||
// }
|
||||
// }
|
||||
functionDialogBox(
|
||||
BidRegistrationForm,
|
||||
{},
|
||||
{
|
||||
title: '新增投标登记',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit2(value)
|
||||
function handleOpenDialog2(data: any = null) {
|
||||
if (data) {
|
||||
functionDialogBox(
|
||||
BidRegistrationForm,
|
||||
{
|
||||
newData: data
|
||||
},
|
||||
{
|
||||
title: '编辑投标登记',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit2({ id: data.id, ...value })
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
} else {
|
||||
functionDialogBox(
|
||||
BidRegistrationForm,
|
||||
{},
|
||||
{
|
||||
title: '新增投标登记',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit2(value)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -360,7 +435,7 @@ const handleSubmit = useDebounceFn(async (data: any) => {
|
||||
|
||||
try {
|
||||
if (userId) {
|
||||
// await UserAPI.update(userId, formData)
|
||||
await BusinessEditproject(data)
|
||||
ElMessage.success('修改用户成功')
|
||||
} else {
|
||||
await BusinessProject(data)
|
||||
@@ -380,7 +455,7 @@ const handleSubmit2 = useDebounceFn(async (data: any) => {
|
||||
|
||||
try {
|
||||
if (userId) {
|
||||
// await UserAPI.update(userId, formData)
|
||||
await BusinessEditBid({ ...data, BiddingUnit: JSON.stringify(data.BiddingUnit) })
|
||||
ElMessage.success('修改用户成功')
|
||||
} else {
|
||||
await BusinessBid({
|
||||
@@ -398,6 +473,48 @@ const handleSubmit2 = useDebounceFn(async (data: any) => {
|
||||
}
|
||||
}, 300)
|
||||
|
||||
const onUserDeleteDepartment = (id: string) => {
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
BusinessDeleteProject(id)
|
||||
.then((res: any) => {
|
||||
ElMessage.success(res.message)
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
},
|
||||
() => {
|
||||
ElMessage.info('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
const onUserDeleteDepartment2 = (id: string) => {
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
BusinessDeleteBid(id)
|
||||
.then((res: any) => {
|
||||
ElMessage.success(res.message)
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
},
|
||||
() => {
|
||||
ElMessage.info('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// ==================== 生命周期 ====================
|
||||
|
||||
/**
|
||||
|
||||
@@ -162,6 +162,14 @@
|
||||
<script lang="ts" setup>
|
||||
import { Delete, Plus } from '@element-plus/icons-vue'
|
||||
import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { deepCloneByJSON, isValidFormat } from '@/utils/auxiliaryFunction'
|
||||
|
||||
const props = defineProps({
|
||||
newData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
@@ -297,12 +305,31 @@ const DepartmentList = () => {
|
||||
|
||||
onMounted(() => {
|
||||
DepartmentList()
|
||||
setFormData(props.newData)
|
||||
})
|
||||
|
||||
const getForm = () => {
|
||||
return formData
|
||||
}
|
||||
|
||||
const setFormData = (data: any) => {
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
if (isValidFormat(data1.client_username)) {
|
||||
data1.client_username = JSON.parse(data1.client_username)
|
||||
} else {
|
||||
data1.client_username = []
|
||||
}
|
||||
if (isValidFormat(data1.party_username)) {
|
||||
data1.party_username = JSON.parse(data1.party_username)
|
||||
} else {
|
||||
data1.party_username = []
|
||||
}
|
||||
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
}
|
||||
|
||||
const submit = (): Promise<boolean> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
formRef.value?.validate((valid: boolean) => {
|
||||
|
||||
@@ -32,14 +32,6 @@
|
||||
<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
|
||||
@@ -51,36 +43,43 @@
|
||||
class="data-table__content"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="委托人信息" prop="client_username">
|
||||
<el-table-column label="委托人信息" align="center" prop="client_username">
|
||||
<el-table-column v-slot="{ row }" prop="client_username" label="自然人姓名/法人名称">
|
||||
{{
|
||||
JSON.parse(row.client_username)
|
||||
.map((item: any) => item.name)
|
||||
.join(',')
|
||||
isValidFormat(row.client_username)
|
||||
? 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(',')
|
||||
isValidFormat(row.client_username)
|
||||
? 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 label="相对方信息" align="center" prop="party_username">
|
||||
<el-table-column v-slot="{ row }" prop="party_username" label="自然人姓名/法人名称">
|
||||
{{
|
||||
JSON.parse(row.party_username)
|
||||
.map((item: any) => item.name)
|
||||
.join(',')
|
||||
isValidFormat(row.party_username)
|
||||
? 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(',')
|
||||
isValidFormat(row.party_username)
|
||||
? JSON.parse(row.party_username)
|
||||
.map((item: any) => item.idNumber)
|
||||
.join(',')
|
||||
: '异常'
|
||||
}}
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
@@ -94,7 +93,7 @@
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog(scope.row.id)"
|
||||
@click="handleOpenDialog(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
@@ -123,12 +122,18 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import RoleAPI, { RolePageVO } from '@/api/system/role-api'
|
||||
import { UserDeleteDepartment } from '@/api/calibration/department'
|
||||
import { RolePageVO } from '@/api/system/role-api'
|
||||
import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { functionDialogBox } from '@/utils/functionDialogBox'
|
||||
import PreRegistrationForm from './components/PreRegistrationForm.vue'
|
||||
import { BusinessRegister, BusinessRegisterdetail } from '@/api/calibration/preRegistration'
|
||||
import {
|
||||
BusinessDeleteRegistration,
|
||||
BusinessEditRegistration,
|
||||
BusinessRegister,
|
||||
BusinessRegisterdetail
|
||||
} from '@/api/calibration/preRegistration'
|
||||
import { isValidFormat } from '@/utils/auxiliaryFunction'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
defineOptions({
|
||||
name: 'Role',
|
||||
@@ -193,21 +198,22 @@ function handleSelectionChange(selection: any) {
|
||||
}
|
||||
|
||||
// 打开角色弹窗
|
||||
function handleOpenDialog(roleId?: string) {
|
||||
function handleOpenDialog(data?: any) {
|
||||
dialog.visible = true
|
||||
const roleId = data?.id
|
||||
if (roleId) {
|
||||
functionDialogBox(
|
||||
PreRegistrationForm,
|
||||
{},
|
||||
{
|
||||
newData: data
|
||||
},
|
||||
{
|
||||
title: '编辑预立案登记',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
console.log('value', value)
|
||||
handleSubmit({ id: roleId, ...value })
|
||||
}
|
||||
// cancel() {
|
||||
// console.log("value");
|
||||
// },
|
||||
}
|
||||
)
|
||||
} else {
|
||||
@@ -220,9 +226,6 @@ function handleOpenDialog(roleId?: string) {
|
||||
ok(value: any) {
|
||||
handleSubmit(value)
|
||||
}
|
||||
// cancel() {
|
||||
// console.log("value");
|
||||
// },
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -233,13 +236,16 @@ 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))
|
||||
BusinessEditRegistration({
|
||||
...data,
|
||||
client_username: JSON.stringify(data.client_username),
|
||||
party_username: JSON.stringify(data.party_username)
|
||||
})
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
} else {
|
||||
BusinessRegister({
|
||||
...data,
|
||||
@@ -262,36 +268,9 @@ const onUserDeleteDepartment = (id: string) => {
|
||||
}).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('删除成功')
|
||||
BusinessDeleteRegistration(id)
|
||||
.then((res: any) => {
|
||||
ElMessage.success(res.message)
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
<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 对象
|
||||
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,120 @@
|
||||
<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 对象
|
||||
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,256 @@
|
||||
<template>
|
||||
<div class="pre-registration-form">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="auto"
|
||||
label-position="top"
|
||||
>
|
||||
<el-form-item v-if="!newData?.id" 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 v-if="!newData?.id" 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 } from '@/api/calibration/preRegistration'
|
||||
import { deepCloneByJSON, getFileInfo } from '@/utils/auxiliaryFunction'
|
||||
|
||||
const props = defineProps({
|
||||
newData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
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 对象
|
||||
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()
|
||||
setFormData(props.newData)
|
||||
})
|
||||
|
||||
const getForm = () => {
|
||||
return formData
|
||||
}
|
||||
|
||||
const setFormData = (data: any) => {
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
data1.AgencyContract = getFileInfo(data1.AgencyContract)
|
||||
data1.Contractreturn = getFileInfo(data1.Contractreturn)
|
||||
data1.Closingapplication = getFileInfo(data1.Closingapplication)
|
||||
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
}
|
||||
|
||||
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>
|
||||
429
src/views/calibration/caseManagement/index.vue
Normal file
429
src/views/calibration/caseManagement/index.vue
Normal file
@@ -0,0 +1,429 @@
|
||||
<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"
|
||||
: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"
|
||||
: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"
|
||||
: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="委托人信息" align="center" 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="相对方信息" align="center" 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)"
|
||||
>
|
||||
编辑
|
||||
</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 { 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,
|
||||
BusinessDeleteCase, BusinessEditCase,
|
||||
} 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(data: any = null) {
|
||||
dialog.visible = true
|
||||
if (data) {
|
||||
functionDialogBox(
|
||||
CaseManagementForm,
|
||||
{
|
||||
newData: data
|
||||
},
|
||||
{
|
||||
title: '编辑案件',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit({ id: data.id, ...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) {
|
||||
BusinessEditCase(data)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
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
|
||||
BusinessDeleteCase(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>
|
||||
@@ -823,7 +823,6 @@ function handleDelete(id?: string | number): void {
|
||||
function handleFileSelect(file: any, field: string): void {
|
||||
// 将文件对象保存到表单数据中
|
||||
formData[field] = file.raw // file.raw 是实际的 File 对象
|
||||
console.log(formData[field])
|
||||
userFormRef.value.clearValidate(field)
|
||||
ElMessage.success('文件选择成功')
|
||||
}
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
<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="unit">
|
||||
<el-input v-model="formData.unit" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库标的" prop="mark">
|
||||
<el-input v-model="formData.mark" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="主办律师" prop="lawyer">
|
||||
<el-select v-model="formData.lawyer" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in PersoninchargeList"
|
||||
:key="item.id"
|
||||
:label="item.username"
|
||||
:value="item.username"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库期限" prop="deadline">
|
||||
<el-input v-model="formData.deadline" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库合同" prop="contract">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
action="#"
|
||||
:auto-upload="false"
|
||||
:show-file-list="false"
|
||||
:on-change="(file) => handleFileSelect(file, 'contract')"
|
||||
:before-upload="handleBeforeUpload"
|
||||
>
|
||||
<div v-if="formData.contract" class="upload-preview">
|
||||
<span>{{ formData.contract.name }}</span>
|
||||
<el-button type="danger" size="small" @click.stop="removeFile('contract')">
|
||||
删除
|
||||
</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 { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { deepCloneByJSON, getFileInfo } from '@/utils/auxiliaryFunction'
|
||||
|
||||
const props = defineProps({
|
||||
newData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
const formData = reactive<any>({
|
||||
unit: '',
|
||||
mark: '',
|
||||
lawyer: '',
|
||||
deadline: '',
|
||||
contract: undefined
|
||||
})
|
||||
|
||||
const PersoninchargeList = ref<any[]>([])
|
||||
|
||||
const formRules = reactive<any>({
|
||||
unit: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
mark: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
lawyer: [{ required: true, message: '请选择', trigger: 'blur' }],
|
||||
deadline: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
contract: [{ required: true, message: '请选择', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
function handleFileSelect(file: any, field: string): void {
|
||||
// 将文件对象保存到表单数据中
|
||||
formData[field] = file.raw // file.raw 是实际的 File 对象
|
||||
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
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
DepartmentList()
|
||||
setFormData(props.newData)
|
||||
})
|
||||
|
||||
const getForm = () => {
|
||||
return formData
|
||||
}
|
||||
|
||||
const setFormData = (data: any) => {
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
data1.contract = getFileInfo(data1.contract)
|
||||
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
}
|
||||
|
||||
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>
|
||||
279
src/views/calibration/inventoryRegistration/index.vue
Normal file
279
src/views/calibration/inventoryRegistration/index.vue
Normal file
@@ -0,0 +1,279 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索区域 -->
|
||||
<div class="search-container">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item prop="unit" label="单位">
|
||||
<el-input
|
||||
v-model="queryParams.unit"
|
||||
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>
|
||||
</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="unit" />
|
||||
<el-table-column label="入库标的" prop="mark" />
|
||||
<el-table-column label="主办律师" prop="lawyer" />
|
||||
<el-table-column label="入库期限" prop="deadline" />
|
||||
<el-table-column label="用印文件" prop="contract">
|
||||
<template #default="{ row }">
|
||||
<el-link v-if="row.contract" :href="getFileInfo(row.contract)?.url" target="_blank">
|
||||
{{ getFileInfo(row.contract)?.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
|
||||
icon="edit"
|
||||
@click="handleOpenDialog(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</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 { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { functionDialogBox } from '@/utils/functionDialogBox'
|
||||
import StampingForm from './components/StampingForm.vue'
|
||||
|
||||
import { getFileInfo } from '@/utils/auxiliaryFunction'
|
||||
import {
|
||||
BusinessDeleteWarehousing,
|
||||
BusinessEditWarehousing,
|
||||
BusinessWarehousing,
|
||||
BusinessWarehousingdetail
|
||||
} from '@/api/calibration/inventoryRegistration'
|
||||
|
||||
defineOptions({
|
||||
name: 'Role',
|
||||
inheritAttrs: false
|
||||
})
|
||||
|
||||
const queryFormRef = 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: [],
|
||||
unit: ''
|
||||
})
|
||||
|
||||
// 表格数据
|
||||
const roleList = ref<RolePageVO[]>()
|
||||
|
||||
// 弹窗
|
||||
const dialog = reactive({
|
||||
title: '',
|
||||
visible: false
|
||||
})
|
||||
|
||||
// 获取数据
|
||||
function fetchData() {
|
||||
loading.value = true
|
||||
BusinessWarehousingdetail(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(data: any = null) {
|
||||
dialog.visible = true
|
||||
if (data) {
|
||||
functionDialogBox(
|
||||
StampingForm,
|
||||
{
|
||||
newData: data
|
||||
},
|
||||
{
|
||||
title: '编辑申请用印',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit({ id: data.id, ...value })
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
functionDialogBox(
|
||||
StampingForm,
|
||||
{},
|
||||
{
|
||||
title: '新增申请用印',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit(value)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交角色表单
|
||||
function handleSubmit(data: any) {
|
||||
loading.value = true
|
||||
const roleId = data.id
|
||||
if (roleId) {
|
||||
BusinessEditWarehousing(data)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
} else {
|
||||
BusinessWarehousing(data)
|
||||
.then(() => {
|
||||
ElMessage.success('新增成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
}
|
||||
}
|
||||
|
||||
const onUserDeleteDepartment = (id: string) => {
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
BusinessDeleteWarehousing(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
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
DepartmentList()
|
||||
})
|
||||
</script>
|
||||
@@ -32,14 +32,6 @@
|
||||
<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
|
||||
@@ -69,7 +61,7 @@
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog(scope.row.id)"
|
||||
@click="handleOpenDialog(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
@@ -209,9 +201,14 @@ import { useUserStore } from '@/store'
|
||||
import { DeviceEnum } from '@/enums/settings/device-enum'
|
||||
|
||||
import RoleAPI, { RolePageVO } from '@/api/system/role-api'
|
||||
import { UserDeleteDepartment } from '@/api/calibration/department'
|
||||
import { FinanceIssueDetail, FinanceIssueInvoice } from '@/api/calibration/invoiceApplication'
|
||||
import {
|
||||
FinanceDeleteInvoice,
|
||||
FinanceEditInvoice,
|
||||
FinanceIssueDetail,
|
||||
FinanceIssueInvoice
|
||||
} from '@/api/calibration/invoiceApplication'
|
||||
import { QuestionFilled, Switch } from '@element-plus/icons-vue'
|
||||
import { deepCloneByJSON } from '@/utils/auxiliaryFunction'
|
||||
|
||||
defineOptions({
|
||||
name: 'Role',
|
||||
@@ -251,6 +248,7 @@ const drawerSize = computed(() => (appStore.device === DeviceEnum.DESKTOP ? '600
|
||||
|
||||
// 角色表单
|
||||
const formData = reactive<any>({
|
||||
id: '',
|
||||
ContractNo: '',
|
||||
personincharge: '',
|
||||
amount: '',
|
||||
@@ -318,15 +316,17 @@ function handleSelectionChange(selection: any) {
|
||||
}
|
||||
|
||||
// 打开角色弹窗
|
||||
function handleOpenDialog(roleId?: string) {
|
||||
function handleOpenDialog(data: any = null) {
|
||||
dialog.visible = true
|
||||
if (roleId) {
|
||||
dialog.title = '修改角色'
|
||||
RoleAPI.getFormData(roleId).then((data) => {
|
||||
Object.assign(formData, data)
|
||||
})
|
||||
if (data) {
|
||||
dialog.title = '修改开票申请'
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
} else {
|
||||
dialog.title = '新增角色'
|
||||
dialog.title = '新增开票申请'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,7 +337,7 @@ function handleSubmit() {
|
||||
loading.value = true
|
||||
const roleId = formData.id
|
||||
if (roleId) {
|
||||
RoleAPI.update(roleId, formData)
|
||||
FinanceEditInvoice(formData)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleCloseDialog()
|
||||
@@ -378,7 +378,7 @@ const onUserDeleteDepartment = (id: string) => {
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
UserDeleteDepartment(id)
|
||||
FinanceDeleteInvoice(id)
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
handleResetQuery()
|
||||
@@ -390,58 +390,6 @@ const onUserDeleteDepartment = (id: string) => {
|
||||
}
|
||||
)
|
||||
}
|
||||
// 删除角色
|
||||
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('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// 打开分配菜单权限弹窗
|
||||
// async function handleOpenAssignPermDialog(row: RolePageVO) {
|
||||
// const roleId = row.id;
|
||||
// if (roleId) {
|
||||
// assignPermDialogVisible.value = true;
|
||||
// loading.value = true;
|
||||
//
|
||||
// checkedRole.value.id = roleId;
|
||||
// checkedRole.value.name = row.name;
|
||||
//
|
||||
// // 获取所有的菜单
|
||||
// menuPermOptions.value = await MenuAPI.getOptions();
|
||||
//
|
||||
// // 回显角色已拥有的菜单
|
||||
// RoleAPI.getRoleMenuIds(roleId)
|
||||
// .then((data) => {
|
||||
// const checkedMenuIds = data;
|
||||
// checkedMenuIds.forEach((menuId) => permTreeRef.value!.setChecked(menuId, true, false));
|
||||
// })
|
||||
// .finally(() => {
|
||||
// loading.value = false;
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// 分配菜单权限提交
|
||||
function handleAssignPermSubmit() {
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
<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="title">
|
||||
<el-input v-model="formData.title" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" 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'
|
||||
import { convertFilePathsToObject, isValidJson } from '@/utils/auxiliaryFunction'
|
||||
|
||||
const props = defineProps({
|
||||
newData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
const formData = reactive<any>({
|
||||
title: '',
|
||||
remark: '',
|
||||
file: undefined
|
||||
})
|
||||
|
||||
const formRules = reactive<any>({
|
||||
title: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
remark: [{ 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 对象
|
||||
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('文件已删除')
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
setFormData(props.newData)
|
||||
})
|
||||
|
||||
function deepCloneByJSON(obj: any) {
|
||||
try {
|
||||
return JSON.parse(JSON.stringify(obj))
|
||||
} catch (error) {
|
||||
console.error('深拷贝失败:', error)
|
||||
return obj
|
||||
}
|
||||
}
|
||||
|
||||
const setFormData = (data: any) => {
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
if (data1.file && isValidJson(data1.file)) {
|
||||
data1.file = convertFilePathsToObject(JSON.parse(data1.file))[0]
|
||||
} else {
|
||||
data1.file = undefined
|
||||
}
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
}
|
||||
|
||||
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>
|
||||
210
src/views/calibration/lawFirmStandardDocuments/index.vue
Normal file
210
src/views/calibration/lawFirmStandardDocuments/index.vue
Normal file
@@ -0,0 +1,210 @@
|
||||
<template>
|
||||
<div class="performance-list-container">
|
||||
<el-button type="primary" icon="edit" style="margin-bottom: 20px" @click="handleOpenDialog()">
|
||||
新增律所文件
|
||||
</el-button>
|
||||
<div v-for="(item, index) in performanceList" :key="index" class="performance-item">
|
||||
<div class="item-content">
|
||||
<h3 class="item-title">{{ item.title }}</h3>
|
||||
<p class="item-description">{{ item.remark }}</p>
|
||||
</div>
|
||||
<div class="item-arrow" @click="onUserDeleteDepartment(item.id)">
|
||||
<el-button type="danger" size="large" link @click="handleItemClick(item)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="item-arrow">
|
||||
<el-link
|
||||
v-if="item.file"
|
||||
type="primary"
|
||||
:href="getFileInfo(item.file)?.url"
|
||||
target="_blank"
|
||||
:underline="false"
|
||||
>
|
||||
<el-icon><View /></el-icon>
|
||||
</el-link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { Delete, View } from '@element-plus/icons-vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import {
|
||||
BusinessLawdisplay,
|
||||
BusinessLawyerflie,
|
||||
BusinessLwaDetail
|
||||
} from '@/api/calibration/lawFirmStandardDocuments/index.js'
|
||||
import { BusinessEditBulletin } from '@/api/calibration/announcementManagement'
|
||||
import { functionDialogBox } from '@/utils/functionDialogBox'
|
||||
import LawFirmStandardsForm from './components/LawFirmStandardsForm.vue'
|
||||
import { getFileInfo } from '@/utils/auxiliaryFunction'
|
||||
|
||||
// 定义列表数据
|
||||
const performanceList = ref<any[]>([])
|
||||
|
||||
// 获取数据
|
||||
function fetchData() {
|
||||
BusinessLawdisplay()
|
||||
.then((res: any) => {
|
||||
performanceList.value = res.data
|
||||
})
|
||||
.finally(() => {})
|
||||
}
|
||||
|
||||
// 重置查询
|
||||
function handleResetQuery() {
|
||||
fetchData()
|
||||
}
|
||||
|
||||
// 打开弹窗
|
||||
function handleOpenDialog(data?: any) {
|
||||
if (data?.id) {
|
||||
functionDialogBox(
|
||||
LawFirmStandardsForm,
|
||||
{
|
||||
newData: data
|
||||
},
|
||||
{
|
||||
title: '编辑律所标准文件',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit({ ...value, id: data?.id })
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
functionDialogBox(
|
||||
LawFirmStandardsForm,
|
||||
{},
|
||||
{
|
||||
title: '新增律所标准文件',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit(value)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交表单
|
||||
function handleSubmit(data: any) {
|
||||
const roleId = data.id
|
||||
if (roleId) {
|
||||
BusinessEditBulletin(data)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => ({}))
|
||||
} else {
|
||||
BusinessLawyerflie(data)
|
||||
.then(() => {
|
||||
ElMessage.success('新增成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => ({}))
|
||||
}
|
||||
}
|
||||
|
||||
const onUserDeleteDepartment = (id: string) => {
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
BusinessLwaDetail(id)
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => ({}))
|
||||
},
|
||||
() => {
|
||||
ElMessage.info('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// 点击事件处理
|
||||
function handleItemClick(item: any) {
|
||||
ElMessage.info(`您点击了:${item.title}`)
|
||||
|
||||
// 这里可以添加跳转或其他逻辑
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.performance-list-container {
|
||||
width: 100%;
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.performance-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 120px;
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
margin-bottom: 15px;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
||||
border-color: #409eff;
|
||||
}
|
||||
|
||||
.item-header {
|
||||
flex-shrink: 0;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.item-image {
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
object-fit: cover;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.item-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
margin: 0 0 8px 0;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.item-description {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
color: #909399;
|
||||
line-height: 1.5;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
}
|
||||
.item-arrow {
|
||||
margin-right: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,126 @@
|
||||
<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="title">
|
||||
<el-input v-model="formData.title" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="内容" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="tiems">
|
||||
<el-date-picker
|
||||
v-model="formData.tiems"
|
||||
type="daterange"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择"
|
||||
range-separator="至"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const props = defineProps({
|
||||
newData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
const formData = reactive<any>({
|
||||
title: '',
|
||||
remark: '',
|
||||
tiems: []
|
||||
})
|
||||
|
||||
const formRules = reactive<any>({
|
||||
title: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
remark: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
tiems: [{ required: true, message: '请选择', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
setFormData(props.newData)
|
||||
})
|
||||
|
||||
function deepCloneByJSON(obj: any) {
|
||||
try {
|
||||
return JSON.parse(JSON.stringify(obj))
|
||||
} catch (error) {
|
||||
console.error('深拷贝失败:', error)
|
||||
return obj
|
||||
}
|
||||
}
|
||||
|
||||
const setFormData = (data: any) => {
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
data1.tiems = [data1.tiems, data1.end_time]
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
}
|
||||
|
||||
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>
|
||||
238
src/views/calibration/lmportantScheduleManagement/index.vue
Normal file
238
src/views/calibration/lmportantScheduleManagement/index.vue
Normal file
@@ -0,0 +1,238 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<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>
|
||||
</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="title" />
|
||||
<el-table-column label="内容" prop="remark" />
|
||||
<el-table-column label="是否完成" prop="state" />
|
||||
<el-table-column label="开始时间" prop="tiems" />
|
||||
<el-table-column label="结束时间" prop="end_time" />
|
||||
<el-table-column fixed="right" label="操作" width="240">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="CompleteTheSchedule(scope.row)"
|
||||
>
|
||||
完成日程
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</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 { RolePageVO } from '@/api/system/role-api'
|
||||
import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { functionDialogBox } from '@/utils/functionDialogBox'
|
||||
import LmportantScheduleForm from './components/LmportantScheduleForm.vue'
|
||||
import {
|
||||
BusinessDscheduledetail,
|
||||
BusinessEditSchedule,
|
||||
BusinessHandleSchedule,
|
||||
BusinessSchedule,
|
||||
BusinessScheduleDetail
|
||||
} from '@/api/calibration/lmportantScheduleManagement'
|
||||
|
||||
defineOptions({
|
||||
name: 'Role',
|
||||
inheritAttrs: false
|
||||
})
|
||||
|
||||
const queryFormRef = 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
|
||||
})
|
||||
|
||||
// 表格数据
|
||||
const roleList = ref<RolePageVO[]>()
|
||||
|
||||
// 弹窗
|
||||
const dialog = reactive({
|
||||
title: '',
|
||||
visible: false
|
||||
})
|
||||
|
||||
// 获取数据
|
||||
function fetchData() {
|
||||
loading.value = true
|
||||
BusinessScheduleDetail(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(data?: any) {
|
||||
dialog.visible = true
|
||||
if (data?.id) {
|
||||
functionDialogBox(
|
||||
LmportantScheduleForm,
|
||||
{
|
||||
newData: data
|
||||
},
|
||||
{
|
||||
title: '编辑日程',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit({ ...value, id: data?.id })
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
functionDialogBox(
|
||||
LmportantScheduleForm,
|
||||
{},
|
||||
{
|
||||
title: '新增日程',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit(value)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交角色表单
|
||||
function handleSubmit(data: any) {
|
||||
loading.value = true
|
||||
const roleId = data.id
|
||||
if (roleId) {
|
||||
BusinessEditSchedule(data)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
} else {
|
||||
BusinessSchedule(data)
|
||||
.then(() => {
|
||||
ElMessage.success('新增成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
}
|
||||
}
|
||||
|
||||
const onUserDeleteDepartment = (id: string) => {
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
BusinessDscheduledetail(id)
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
},
|
||||
() => {
|
||||
ElMessage.info('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
const CompleteTheSchedule = (data: any) => {
|
||||
ElMessageBox.confirm('确认已经完成该日程吗?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: ''
|
||||
}).then(() => {
|
||||
loading.value = true
|
||||
BusinessHandleSchedule({ id: data.id, state: '是' })
|
||||
.then((res: any) => {
|
||||
ElMessage.success(res.message)
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
})
|
||||
}
|
||||
|
||||
const DepartmentList = () => {
|
||||
UserPersonneldisplay().then((res: any) => {
|
||||
personinchargeList.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
DepartmentList()
|
||||
})
|
||||
</script>
|
||||
@@ -32,14 +32,6 @@
|
||||
<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
|
||||
@@ -66,7 +58,7 @@
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog(scope.row.id)"
|
||||
@click="handleOpenDialog(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
@@ -126,7 +118,7 @@
|
||||
<el-form-item label="申请人" prop="applicant">
|
||||
<el-input v-model="formData.applicant" placeholder="请输入申请人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="代办审核人" prop="personincharge">
|
||||
<el-form-item v-if="!formData?.id" label="代办审核人" prop="personincharge">
|
||||
<el-select v-model="formData.personincharge" placeholder="请选择代办审核人">
|
||||
<el-option
|
||||
v-for="item in personinchargeList"
|
||||
@@ -214,12 +206,14 @@ import { useAppStore } from '@/store/modules/app-store'
|
||||
import { DeviceEnum } from '@/enums/settings/device-enum'
|
||||
|
||||
import RoleAPI, { RolePageVO } from '@/api/system/role-api'
|
||||
import { UserDeleteDepartment } from '@/api/calibration/department'
|
||||
import {
|
||||
FinanceDeletePayment,
|
||||
FinanceEditPayment,
|
||||
FinancePaymentDisplay,
|
||||
FinancePaymentRequest
|
||||
} from '@/api/calibration/paymentApplicationForm'
|
||||
import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { deepCloneByJSON } from '@/utils/auxiliaryFunction'
|
||||
|
||||
defineOptions({
|
||||
name: 'Role',
|
||||
@@ -259,6 +253,7 @@ const drawerSize = computed(() => (appStore.device === DeviceEnum.DESKTOP ? '600
|
||||
|
||||
// 角色表单
|
||||
const formData = reactive<any>({
|
||||
id: '',
|
||||
reason: '',
|
||||
amount: '',
|
||||
times: '',
|
||||
@@ -325,15 +320,17 @@ function handleSelectionChange(selection: any) {
|
||||
}
|
||||
|
||||
// 打开角色弹窗
|
||||
function handleOpenDialog(roleId?: string) {
|
||||
function handleOpenDialog(data: any = null) {
|
||||
dialog.visible = true
|
||||
if (roleId) {
|
||||
dialog.title = '修改角色'
|
||||
RoleAPI.getFormData(roleId).then((data) => {
|
||||
Object.assign(formData, data)
|
||||
})
|
||||
if (data) {
|
||||
dialog.title = '修改付款申请单'
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
} else {
|
||||
dialog.title = '新增角色'
|
||||
dialog.title = '新增付款申请单'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,7 +341,7 @@ function handleSubmit() {
|
||||
loading.value = true
|
||||
const roleId = formData.id
|
||||
if (roleId) {
|
||||
RoleAPI.update(roleId, formData)
|
||||
FinanceEditPayment(formData)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleCloseDialog()
|
||||
@@ -384,7 +381,7 @@ const onUserDeleteDepartment = (id: string) => {
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
UserDeleteDepartment(id)
|
||||
FinanceDeletePayment(id)
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
handleResetQuery()
|
||||
@@ -396,58 +393,6 @@ const onUserDeleteDepartment = (id: string) => {
|
||||
}
|
||||
)
|
||||
}
|
||||
// 删除角色
|
||||
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('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// 打开分配菜单权限弹窗
|
||||
// async function handleOpenAssignPermDialog(row: RolePageVO) {
|
||||
// const roleId = row.id;
|
||||
// if (roleId) {
|
||||
// assignPermDialogVisible.value = true;
|
||||
// loading.value = true;
|
||||
//
|
||||
// checkedRole.value.id = roleId;
|
||||
// checkedRole.value.name = row.name;
|
||||
//
|
||||
// // 获取所有的菜单
|
||||
// menuPermOptions.value = await MenuAPI.getOptions();
|
||||
//
|
||||
// // 回显角色已拥有的菜单
|
||||
// RoleAPI.getRoleMenuIds(roleId)
|
||||
// .then((data) => {
|
||||
// const checkedMenuIds = data;
|
||||
// checkedMenuIds.forEach((menuId) => permTreeRef.value!.setChecked(menuId, true, false));
|
||||
// })
|
||||
// .finally(() => {
|
||||
// loading.value = false;
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// 分配菜单权限提交
|
||||
function handleAssignPermSubmit() {
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
<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="parent">-->
|
||||
<!-- <el-select v-model="formData.parent" placeholder="请选择">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="(item, index) in parentList"-->
|
||||
<!-- :key="index"-->
|
||||
<!-- :label="item.name"-->
|
||||
<!-- :value="item.value"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="权限名" prop="permission_name">
|
||||
<el-input v-model="formData.permission_name" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="权限标识" prop="permission_logo">
|
||||
<el-input v-model="formData.permission_logo" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { convertFilePathsToObject, isValidJson } from '@/utils/auxiliaryFunction'
|
||||
|
||||
const props = defineProps({
|
||||
newData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const formRef = ref()
|
||||
// const parentList = [
|
||||
// {
|
||||
// name: '无',
|
||||
// value: '0'
|
||||
// }
|
||||
// ]
|
||||
// 表单数据
|
||||
const formData = reactive<any>({
|
||||
permission_name: '',
|
||||
permission_logo: ''
|
||||
})
|
||||
|
||||
const formRules = reactive<any>({
|
||||
permission_name: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
permission_logo: [{ required: true, message: '请输入', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
setFormData(props.newData)
|
||||
})
|
||||
|
||||
function deepCloneByJSON(obj: any) {
|
||||
try {
|
||||
return JSON.parse(JSON.stringify(obj))
|
||||
} catch (error) {
|
||||
console.error('深拷贝失败:', error)
|
||||
return obj
|
||||
}
|
||||
}
|
||||
|
||||
const setFormData = (data: any) => {
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
if (data1.file && isValidJson(data1.file)) {
|
||||
data1.file = convertFilePathsToObject(JSON.parse(data1.file))[0]
|
||||
} else {
|
||||
data1.file = undefined
|
||||
}
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
}
|
||||
|
||||
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>
|
||||
289
src/views/calibration/permissionManagement/index.vue
Normal file
289
src/views/calibration/permissionManagement/index.vue
Normal file
@@ -0,0 +1,289 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索区域 -->
|
||||
<!-- <div class="search-container">-->
|
||||
<!-- <el-form ref="queryFormRef" :model="queryParams" :inline="true">-->
|
||||
<!-- <el-form-item prop="unit" label="单位">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.unit"-->
|
||||
<!-- 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({}, '0')">新增</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"
|
||||
default-expand-all
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||
<el-table-column label="权限名" prop="permission_name" />
|
||||
<el-table-column label="权限标识" prop="permission_logo" />
|
||||
<!-- <el-table-column label="时间" prop="times" />-->
|
||||
<el-table-column fixed="right" label="操作" width="240">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog({}, scope.row.id)"
|
||||
>
|
||||
新增下级
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog(scope.row, 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 { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { functionDialogBox } from '@/utils/functionDialogBox'
|
||||
import permissionForm from './components/permissionForm.vue'
|
||||
import {
|
||||
BusinessAddRermission,
|
||||
BusinessDeleteRermission,
|
||||
BusinessDisplayRermission,
|
||||
BusinessEditRermission
|
||||
} from '@/api/calibration/permissionManagement'
|
||||
|
||||
defineOptions({
|
||||
name: 'Role',
|
||||
inheritAttrs: false
|
||||
})
|
||||
|
||||
const queryFormRef = 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: [],
|
||||
// unit: ''
|
||||
})
|
||||
|
||||
// 表格数据
|
||||
const roleList = ref<RolePageVO[]>()
|
||||
|
||||
// 弹窗
|
||||
const dialog = reactive({
|
||||
title: '',
|
||||
visible: false
|
||||
})
|
||||
|
||||
// 获取数据
|
||||
function fetchData() {
|
||||
loading.value = true
|
||||
BusinessDisplayRermission()
|
||||
.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(data?: any, parentId?: string) {
|
||||
dialog.visible = true
|
||||
if (data?.id) {
|
||||
functionDialogBox(
|
||||
permissionForm,
|
||||
{
|
||||
newData: data,
|
||||
parentId
|
||||
},
|
||||
{
|
||||
title: '编辑注册平台登记',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit({ ...value, id: data?.id, parent: parentId })
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
functionDialogBox(
|
||||
permissionForm,
|
||||
{
|
||||
parentId
|
||||
},
|
||||
{
|
||||
title: '新增注册平台登记',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit({ ...value, parent: parentId })
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交角色表单
|
||||
function handleSubmit(data: any) {
|
||||
loading.value = true
|
||||
const roleId = data.id
|
||||
if (roleId) {
|
||||
BusinessEditRermission(data)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
} else {
|
||||
BusinessAddRermission(data)
|
||||
.then(() => {
|
||||
ElMessage.success('新增成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
}
|
||||
}
|
||||
|
||||
const onUserDeleteDepartment = (id: string) => {
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
BusinessDeleteRermission(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
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
DepartmentList()
|
||||
})
|
||||
</script>
|
||||
@@ -92,6 +92,7 @@
|
||||
v-loading="loading"
|
||||
:data="pageData"
|
||||
border
|
||||
:resizable="false"
|
||||
stripe
|
||||
highlight-current-row
|
||||
class="data-table__content"
|
||||
@@ -106,7 +107,11 @@
|
||||
<!-- <DictLabel v-model="scope.row.gender" code="gender" />-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="部门" align="center" prop="department" />
|
||||
<el-table-column label="部门" align="center" prop="department">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.department.map((item: any) => item.username).join(',') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手机号码" align="center" prop="mobilePhone" />
|
||||
<el-table-column label="学历证书" align="center" prop="AcademicResume">
|
||||
<template #default="{ row }">
|
||||
@@ -222,11 +227,23 @@
|
||||
<el-input v-model="formData.mobilePhone" placeholder="请输入手机号" maxlength="11" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属部门" prop="department">
|
||||
<el-select v-model="formData.department" placeholder="请选择所属部门">
|
||||
<el-option key="行政部" label="行政部" value="行政部" />
|
||||
<el-option key="财务部" label="财务部" value="财务部" />
|
||||
<el-option key="执业律师" label="执业律师" value="执业律师" />
|
||||
<el-option key="实习律师" label="实习律师" value="实习律师" />
|
||||
<el-select v-model="formData.department" multiple placeholder="请选择所属部门">
|
||||
<el-option
|
||||
v-for="(item, index) in deptList"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色" prop="role">
|
||||
<el-select v-model="formData.role" multiple placeholder="请选择">
|
||||
<el-option
|
||||
v-for="(item, index) in roleList"
|
||||
:key="index"
|
||||
:label="item.RoleName"
|
||||
:value="Number(item.id)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位" prop="position">
|
||||
@@ -435,6 +452,8 @@ import {
|
||||
UserPersonnelList
|
||||
} from '@/api/calibration/personnelManagement'
|
||||
import { getFileInfo, convertFilePathsToObject, isValidJson } from '@/utils/auxiliaryFunction'
|
||||
import { UserDepartment } from '@/api/calibration/department'
|
||||
import { BusinessDisplayRole } from '@/api/calibration/roleManagement'
|
||||
|
||||
// ==================== 组件配置 ====================
|
||||
defineOptions({
|
||||
@@ -462,6 +481,8 @@ const queryParams = reactive<any>({
|
||||
|
||||
// 列表数据
|
||||
const pageData = ref<any[]>([])
|
||||
const deptList = ref<any[]>([])
|
||||
const roleList = ref<any[]>([])
|
||||
const total = ref(0)
|
||||
const loading = ref(false)
|
||||
|
||||
@@ -478,9 +499,10 @@ const formData = reactive<any>({
|
||||
password: '',
|
||||
nation: '',
|
||||
IdCard: '',
|
||||
department: '',
|
||||
department: [],
|
||||
mobilePhone: '',
|
||||
position: '',
|
||||
role: [],
|
||||
team: '',
|
||||
Dateofjoining: '',
|
||||
Confirmationtime: '',
|
||||
@@ -557,6 +579,13 @@ const rules = reactive({
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
role: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
mobilePhone: [
|
||||
{
|
||||
required: true,
|
||||
@@ -637,6 +666,17 @@ const fetchUserList = useDebounceFn(async () => {
|
||||
}
|
||||
})
|
||||
|
||||
const DepartmentList = (name: string = '') => {
|
||||
UserDepartment(name).then((res: any) => {
|
||||
deptList.value = res.data
|
||||
})
|
||||
}
|
||||
const onBusinessDisplayRole = (name: string = '') => {
|
||||
BusinessDisplayRole({ RoleName: name }).then((res: any) => {
|
||||
roleList.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
// ==================== 表格选择 ====================
|
||||
const { selectedIds, hasSelection, handleSelectionChange } = useTableSelection<UserPageVO>()
|
||||
|
||||
@@ -729,7 +769,9 @@ async function handleOpenDialog(data?: any): Promise<void> {
|
||||
} else {
|
||||
data1.ApplicationForm = undefined
|
||||
}
|
||||
|
||||
data1.department = data1.department.map((item: any) => item.id)
|
||||
data1.role = data1.role.map((item: any) => item.id)
|
||||
console.log(data1.department, data1.role)
|
||||
Object.assign(formData, data1)
|
||||
} catch (error) {
|
||||
ElMessage.error('加载用户数据失败')
|
||||
@@ -877,7 +919,6 @@ function handleDelete(id?: string | number): void {
|
||||
function handleFileSelect(file: any, field: string): void {
|
||||
// 将文件对象保存到表单数据中
|
||||
formData[field] = file.raw // file.raw 是实际的 File 对象
|
||||
console.log(formData[field])
|
||||
userFormRef.value.clearValidate(field)
|
||||
ElMessage.success('文件选择成功')
|
||||
}
|
||||
@@ -970,6 +1011,8 @@ async function handleExport(): Promise<void> {
|
||||
*/
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
DepartmentList()
|
||||
onBusinessDisplayRole()
|
||||
})
|
||||
watch(
|
||||
() => queryParams.department,
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
<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="platform">
|
||||
<el-input v-model="formData.platform" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="注册号码" prop="number">
|
||||
<el-input v-model="formData.number" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-input v-model="formData.password" type="password" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="注册人" prop="username">
|
||||
<el-select v-model="formData.username" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in PersoninchargeList"
|
||||
:key="item.id"
|
||||
:label="item.username"
|
||||
:value="item.username"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const props = defineProps({
|
||||
newData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
const formData = reactive<any>({
|
||||
platform: '',
|
||||
number: '',
|
||||
password: '',
|
||||
deadline: '',
|
||||
username: ''
|
||||
})
|
||||
|
||||
const PersoninchargeList = ref<any[]>([])
|
||||
|
||||
const formRules = reactive<any>({
|
||||
platform: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
number: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
password: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
username: [{ required: true, message: '请选择', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
const DepartmentList = () => {
|
||||
UserPersonneldisplay().then((res: any) => {
|
||||
PersoninchargeList.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
DepartmentList()
|
||||
setFormData(props.newData)
|
||||
})
|
||||
|
||||
const setFormData = (data: any) => {
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
Object.assign(formData, data)
|
||||
}
|
||||
}
|
||||
|
||||
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>
|
||||
276
src/views/calibration/registrationPlatform/index.vue
Normal file
276
src/views/calibration/registrationPlatform/index.vue
Normal file
@@ -0,0 +1,276 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索区域 -->
|
||||
<!-- <div class="search-container">-->
|
||||
<!-- <el-form ref="queryFormRef" :model="queryParams" :inline="true">-->
|
||||
<!-- <el-form-item prop="unit" label="单位">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.unit"-->
|
||||
<!-- 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="platform" />
|
||||
<el-table-column label="注册号码" prop="number" />
|
||||
<el-table-column label="密码" prop="password" />
|
||||
<el-table-column label="注册人" prop="username" />
|
||||
<el-table-column fixed="right" label="操作" width="140">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</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 { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { functionDialogBox } from '@/utils/functionDialogBox'
|
||||
import RegistrationPlatformForm from './components/RegistrationPlatformForm.vue'
|
||||
import {
|
||||
BusinessDeletePlatform,
|
||||
BusinessEditPlatform,
|
||||
BusinessPlatformDetail,
|
||||
BusinessPlatformRegistration
|
||||
} from '@/api/calibration/registrationPlatform'
|
||||
|
||||
defineOptions({
|
||||
name: 'Role',
|
||||
inheritAttrs: false
|
||||
})
|
||||
|
||||
const queryFormRef = 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: [],
|
||||
// unit: ''
|
||||
})
|
||||
|
||||
// 表格数据
|
||||
const roleList = ref<RolePageVO[]>()
|
||||
|
||||
// 弹窗
|
||||
const dialog = reactive({
|
||||
title: '',
|
||||
visible: false
|
||||
})
|
||||
|
||||
// 获取数据
|
||||
function fetchData() {
|
||||
loading.value = true
|
||||
BusinessPlatformDetail(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(data?: any) {
|
||||
dialog.visible = true
|
||||
if (data?.id) {
|
||||
functionDialogBox(
|
||||
RegistrationPlatformForm,
|
||||
{
|
||||
newData: data
|
||||
},
|
||||
{
|
||||
title: '编辑注册平台登记',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit({ ...value, id: data?.id })
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
functionDialogBox(
|
||||
RegistrationPlatformForm,
|
||||
{},
|
||||
{
|
||||
title: '新增注册平台登记',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit(value)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交角色表单
|
||||
function handleSubmit(data: any) {
|
||||
loading.value = true
|
||||
const roleId = data.id
|
||||
if (roleId) {
|
||||
BusinessEditPlatform(data)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
} else {
|
||||
BusinessPlatformRegistration(data)
|
||||
.then(() => {
|
||||
ElMessage.success('新增成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
}
|
||||
}
|
||||
|
||||
const onUserDeleteDepartment = (id: string) => {
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
BusinessDeletePlatform(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
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
DepartmentList()
|
||||
})
|
||||
</script>
|
||||
@@ -32,14 +32,6 @@
|
||||
<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
|
||||
@@ -64,7 +56,7 @@
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog(scope.row.id)"
|
||||
@click="handleOpenDialog(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
@@ -118,7 +110,7 @@
|
||||
<el-form-item label="费用说明" prop="FeeDescription">
|
||||
<el-input v-model="formData.FeeDescription" placeholder="请输入费用说明" />
|
||||
</el-form-item>
|
||||
<el-form-item label="代办审核人" prop="personincharge">
|
||||
<el-form-item v-if="!formData?.id" label="代办审核人" prop="personincharge">
|
||||
<el-select v-model="formData.personincharge" placeholder="请选择代办审核人">
|
||||
<el-option
|
||||
v-for="item in personinchargeList"
|
||||
@@ -206,9 +198,14 @@ import { useAppStore } from '@/store/modules/app-store'
|
||||
import { DeviceEnum } from '@/enums/settings/device-enum'
|
||||
|
||||
import RoleAPI, { RolePageVO } from '@/api/system/role-api'
|
||||
import { UserDeleteDepartment } from '@/api/calibration/department'
|
||||
import { FinanceReidetail, FinanceReimbursement } from '@/api/calibration/reimbursement'
|
||||
import {
|
||||
FinanceDeleteReimbursement,
|
||||
FinanceEditReimbursement,
|
||||
FinanceReidetail,
|
||||
FinanceReimbursement
|
||||
} from '@/api/calibration/reimbursement'
|
||||
import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { deepCloneByJSON } from '@/utils/auxiliaryFunction'
|
||||
|
||||
defineOptions({
|
||||
name: 'Role',
|
||||
@@ -248,6 +245,7 @@ const drawerSize = computed(() => (appStore.device === DeviceEnum.DESKTOP ? '600
|
||||
|
||||
// 角色表单
|
||||
const formData = reactive<any>({
|
||||
id: '',
|
||||
person: '',
|
||||
times: '',
|
||||
reason: '',
|
||||
@@ -310,15 +308,17 @@ function handleSelectionChange(selection: any) {
|
||||
}
|
||||
|
||||
// 打开角色弹窗
|
||||
function handleOpenDialog(roleId?: string) {
|
||||
function handleOpenDialog(data: any = null) {
|
||||
dialog.visible = true
|
||||
if (roleId) {
|
||||
dialog.title = '修改角色'
|
||||
RoleAPI.getFormData(roleId).then((data) => {
|
||||
Object.assign(formData, data)
|
||||
})
|
||||
if (data) {
|
||||
dialog.title = '修改报销申请'
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
} else {
|
||||
dialog.title = '新增角色'
|
||||
dialog.title = '新增报销申请'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ function handleSubmit() {
|
||||
loading.value = true
|
||||
const roleId = formData.id
|
||||
if (roleId) {
|
||||
RoleAPI.update(roleId, formData)
|
||||
FinanceEditReimbursement(formData)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleCloseDialog()
|
||||
@@ -369,7 +369,7 @@ const onUserDeleteDepartment = (id: string) => {
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
UserDeleteDepartment(id)
|
||||
FinanceDeleteReimbursement(id)
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
handleResetQuery()
|
||||
@@ -381,58 +381,6 @@ const onUserDeleteDepartment = (id: string) => {
|
||||
}
|
||||
)
|
||||
}
|
||||
// 删除角色
|
||||
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('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// 打开分配菜单权限弹窗
|
||||
// async function handleOpenAssignPermDialog(row: RolePageVO) {
|
||||
// const roleId = row.id;
|
||||
// if (roleId) {
|
||||
// assignPermDialogVisible.value = true;
|
||||
// loading.value = true;
|
||||
//
|
||||
// checkedRole.value.id = roleId;
|
||||
// checkedRole.value.name = row.name;
|
||||
//
|
||||
// // 获取所有的菜单
|
||||
// menuPermOptions.value = await MenuAPI.getOptions();
|
||||
//
|
||||
// // 回显角色已拥有的菜单
|
||||
// RoleAPI.getRoleMenuIds(roleId)
|
||||
// .then((data) => {
|
||||
// const checkedMenuIds = data;
|
||||
// checkedMenuIds.forEach((menuId) => permTreeRef.value!.setChecked(menuId, true, false));
|
||||
// })
|
||||
// .finally(() => {
|
||||
// loading.value = false;
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// 分配菜单权限提交
|
||||
function handleAssignPermSubmit() {
|
||||
|
||||
@@ -32,14 +32,6 @@
|
||||
<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
|
||||
@@ -64,7 +56,7 @@
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog(scope.row.id)"
|
||||
@click="handleOpenDialog(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
@@ -118,7 +110,7 @@
|
||||
<el-form-item label="收入分配" prop="allocate">
|
||||
<el-input v-model="formData.allocate" placeholder="请输入收入分配" />
|
||||
</el-form-item>
|
||||
<el-form-item label="代办审核人" prop="personincharge">
|
||||
<el-form-item v-if="!formData?.id" label="代办审核人" prop="personincharge">
|
||||
<el-select v-model="formData.personincharge" placeholder="请选择代办审核人">
|
||||
<el-option
|
||||
v-for="item in personinchargeList"
|
||||
@@ -206,9 +198,14 @@ import { useAppStore } from '@/store/modules/app-store'
|
||||
import { DeviceEnum } from '@/enums/settings/device-enum'
|
||||
|
||||
import RoleAPI, { RolePageVO } from '@/api/system/role-api'
|
||||
import { UserDeleteDepartment } from '@/api/calibration/department'
|
||||
import { FinanceConfirm, FinanceConfirmdisplay } from '@/api/calibration/revenueRecognition'
|
||||
import {
|
||||
FinanceConfirm,
|
||||
FinanceConfirmdisplay,
|
||||
FinanceDeleteIncome,
|
||||
FinanceEditIncome
|
||||
} from '@/api/calibration/revenueRecognition'
|
||||
import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { deepCloneByJSON } from '@/utils/auxiliaryFunction'
|
||||
|
||||
defineOptions({
|
||||
name: 'Role',
|
||||
@@ -248,6 +245,7 @@ const drawerSize = computed(() => (appStore.device === DeviceEnum.DESKTOP ? '600
|
||||
|
||||
// 角色表单
|
||||
const formData = reactive<any>({
|
||||
id: '',
|
||||
times: '',
|
||||
ContractNo: '',
|
||||
CustomerID: '',
|
||||
@@ -265,7 +263,7 @@ const rules = reactive({
|
||||
personincharge: [{ required: true, message: '请输入工资', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
// 选中的角色
|
||||
// 选中的
|
||||
interface CheckedRole {
|
||||
id?: string
|
||||
name?: string
|
||||
@@ -310,15 +308,17 @@ function handleSelectionChange(selection: any) {
|
||||
}
|
||||
|
||||
// 打开角色弹窗
|
||||
function handleOpenDialog(roleId?: string) {
|
||||
function handleOpenDialog(data: any = null) {
|
||||
dialog.visible = true
|
||||
if (roleId) {
|
||||
dialog.title = '修改角色'
|
||||
RoleAPI.getFormData(roleId).then((data) => {
|
||||
Object.assign(formData, data)
|
||||
})
|
||||
if (data) {
|
||||
dialog.title = '修改收入确认'
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
} else {
|
||||
dialog.title = '新增角色'
|
||||
dialog.title = '新增收入确认'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ function handleSubmit() {
|
||||
loading.value = true
|
||||
const roleId = formData.id
|
||||
if (roleId) {
|
||||
RoleAPI.update(roleId, formData)
|
||||
FinanceEditIncome(formData)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleCloseDialog()
|
||||
@@ -369,7 +369,7 @@ const onUserDeleteDepartment = (id: string) => {
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
UserDeleteDepartment(id)
|
||||
FinanceDeleteIncome(id)
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
handleResetQuery()
|
||||
@@ -381,58 +381,6 @@ const onUserDeleteDepartment = (id: string) => {
|
||||
}
|
||||
)
|
||||
}
|
||||
// 删除角色
|
||||
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('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// 打开分配菜单权限弹窗
|
||||
// async function handleOpenAssignPermDialog(row: RolePageVO) {
|
||||
// const roleId = row.id;
|
||||
// if (roleId) {
|
||||
// assignPermDialogVisible.value = true;
|
||||
// loading.value = true;
|
||||
//
|
||||
// checkedRole.value.id = roleId;
|
||||
// checkedRole.value.name = row.name;
|
||||
//
|
||||
// // 获取所有的菜单
|
||||
// menuPermOptions.value = await MenuAPI.getOptions();
|
||||
//
|
||||
// // 回显角色已拥有的菜单
|
||||
// RoleAPI.getRoleMenuIds(roleId)
|
||||
// .then((data) => {
|
||||
// const checkedMenuIds = data;
|
||||
// checkedMenuIds.forEach((menuId) => permTreeRef.value!.setChecked(menuId, true, false));
|
||||
// })
|
||||
// .finally(() => {
|
||||
// loading.value = false;
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// 分配菜单权限提交
|
||||
function handleAssignPermSubmit() {
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<div class="pre-registration-form">
|
||||
<el-tree
|
||||
ref="deptTreeRef"
|
||||
class="mt-2"
|
||||
:data="permissionList"
|
||||
:default-checked-keys="permission"
|
||||
:default-expanded-keys="permission"
|
||||
:props="{ children: 'children', label: 'permission_name', disabled: '' }"
|
||||
node-key="id"
|
||||
highlight-current
|
||||
check-on-click-node
|
||||
:expand-on-click-node="false"
|
||||
show-checkbox
|
||||
:current-node-key="permissionList?.length ? permissionList[0].id : ''"
|
||||
@check="handleCheck"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { BusinessDisplayRermission } from '@/api/calibration/permissionManagement'
|
||||
|
||||
const props = defineProps({
|
||||
newData: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
})
|
||||
const deptTreeRef = ref()
|
||||
const permission = ref<any[]>([])
|
||||
const permissionList = ref<any[]>([])
|
||||
|
||||
const onBusinessDisplayRermission = () => {
|
||||
BusinessDisplayRermission().then((res: any) => {
|
||||
permissionList.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
function handleCheck(_: any, data: any) {
|
||||
permission.value = data.checkedKeys
|
||||
|
||||
console.log('permission.value', data.checkedKeys)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
setFormData(props.newData)
|
||||
onBusinessDisplayRermission()
|
||||
})
|
||||
|
||||
function deepCloneByJSON(obj: any) {
|
||||
try {
|
||||
return JSON.parse(JSON.stringify(obj))
|
||||
} catch (error) {
|
||||
console.error('深拷贝失败:', error)
|
||||
return obj
|
||||
}
|
||||
}
|
||||
|
||||
const setFormData = (data: any) => {
|
||||
permission.value = deepCloneByJSON(data)
|
||||
}
|
||||
|
||||
const getForm = () => {
|
||||
return permission.value
|
||||
}
|
||||
|
||||
const submit = (): Promise<boolean> => {
|
||||
return new Promise((resolve) => {
|
||||
resolve(true)
|
||||
})
|
||||
}
|
||||
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>
|
||||
104
src/views/calibration/roleManagement/components/RoleForm.vue
Normal file
104
src/views/calibration/roleManagement/components/RoleForm.vue
Normal file
@@ -0,0 +1,104 @@
|
||||
<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="RoleName">
|
||||
<el-input v-model="formData.RoleName" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { deepCloneByJSON } from '@/utils/auxiliaryFunction'
|
||||
|
||||
const props = defineProps({
|
||||
newData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
const formData = reactive<any>({
|
||||
RoleName: '',
|
||||
remark: ''
|
||||
})
|
||||
|
||||
const formRules = reactive<any>({
|
||||
RoleName: [{ required: true, message: '请输入', trigger: 'blur' }]
|
||||
// remark: [{ required: true, message: '请输入', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
setFormData(props.newData)
|
||||
})
|
||||
|
||||
const setFormData = (data: any) => {
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
}
|
||||
|
||||
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>
|
||||
312
src/views/calibration/roleManagement/index.vue
Normal file
312
src/views/calibration/roleManagement/index.vue
Normal file
@@ -0,0 +1,312 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索区域 -->
|
||||
<!-- <div class="search-container">-->
|
||||
<!-- <el-form ref="queryFormRef" :model="queryParams" :inline="true">-->
|
||||
<!-- <el-form-item prop="unit" label="单位">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.unit"-->
|
||||
<!-- 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"
|
||||
default-expand-all
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||
<el-table-column label="角色名称" prop="RoleName" />
|
||||
<el-table-column label="备注" prop="remark" />
|
||||
<!-- <el-table-column label="时间" prop="times" />-->
|
||||
<el-table-column fixed="right" label="操作" width="240">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="grantPermissions(scope.row?.id)"
|
||||
>
|
||||
赋予权限
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</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 { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { functionDialogBox } from '@/utils/functionDialogBox'
|
||||
import RoleForm from './components/RoleForm.vue'
|
||||
import GrantPermissionsForm from './components/GrantPermissionsForm.vue'
|
||||
import {
|
||||
BusinessAddRole,
|
||||
BusinessDeleteRole,
|
||||
BusinessDisplayRole,
|
||||
BusinessEditRole,
|
||||
BusinessGetRolePermissions,
|
||||
BusinessModifypermissions
|
||||
} from '@/api/calibration/roleManagement'
|
||||
|
||||
defineOptions({
|
||||
name: 'Role',
|
||||
inheritAttrs: false
|
||||
})
|
||||
|
||||
const queryFormRef = 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,
|
||||
RoleName: ''
|
||||
})
|
||||
|
||||
// 表格数据
|
||||
const roleList = ref<RolePageVO[]>()
|
||||
|
||||
// 弹窗
|
||||
const dialog = reactive({
|
||||
title: '',
|
||||
visible: false
|
||||
})
|
||||
|
||||
// 获取数据
|
||||
function fetchData() {
|
||||
loading.value = true
|
||||
BusinessDisplayRole({ RoleName: queryParams.RoleName })
|
||||
.then((res: any) => {
|
||||
roleList.value = res.data
|
||||
})
|
||||
.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(data?: any) {
|
||||
dialog.visible = true
|
||||
if (data?.id) {
|
||||
functionDialogBox(
|
||||
RoleForm,
|
||||
{
|
||||
newData: data
|
||||
},
|
||||
{
|
||||
title: '编辑角色',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit({ ...value, id: data?.id })
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
functionDialogBox(
|
||||
RoleForm,
|
||||
{},
|
||||
{
|
||||
title: '新增角色',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit(value)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交角色表单
|
||||
function handleSubmit(data: any) {
|
||||
loading.value = true
|
||||
const roleId = data.id
|
||||
if (roleId) {
|
||||
BusinessEditRole(data)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
} else {
|
||||
BusinessAddRole(data)
|
||||
.then(() => {
|
||||
ElMessage.success('新增成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
}
|
||||
}
|
||||
|
||||
const grantPermissions = (id: string) => {
|
||||
BusinessGetRolePermissions(id).then((res: any) => {
|
||||
functionDialogBox(
|
||||
GrantPermissionsForm,
|
||||
{
|
||||
newData: res.data
|
||||
},
|
||||
{
|
||||
title: '权限分配',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
onBusinessModifypermissions({ id, permissionId: value })
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
const onBusinessModifypermissions = (data: any) => {
|
||||
BusinessModifypermissions(data).then(() => {
|
||||
ElMessage.success('操作成功')
|
||||
})
|
||||
}
|
||||
|
||||
const onUserDeleteDepartment = (id: string) => {
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
BusinessDeleteRole(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
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
DepartmentList()
|
||||
})
|
||||
</script>
|
||||
@@ -32,14 +32,6 @@
|
||||
<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
|
||||
@@ -64,7 +56,7 @@
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog(scope.row.id)"
|
||||
@click="handleOpenDialog(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
@@ -107,7 +99,7 @@
|
||||
<el-form-item label="调整说明" prop="Instructions">
|
||||
<el-input v-model="formData.Instructions" placeholder="请输入调整说明" />
|
||||
</el-form-item>
|
||||
<el-form-item label="代办审核人" prop="personincharge">
|
||||
<el-form-item v-if="!formData?.id" label="代办审核人" prop="personincharge">
|
||||
<el-select v-model="formData.personincharge" placeholder="请选择代办审核人">
|
||||
<el-option
|
||||
v-for="item in personinchargeList"
|
||||
@@ -195,9 +187,14 @@ import { useAppStore } from '@/store/modules/app-store'
|
||||
import { DeviceEnum } from '@/enums/settings/device-enum'
|
||||
|
||||
import RoleAPI, { RolePageVO } from '@/api/system/role-api'
|
||||
import { UserDeleteDepartment } from '@/api/calibration/department'
|
||||
import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { FinanceChange, FinanceChangeDetail } from '@/api/calibration/salaryBonusAdjustment'
|
||||
import {
|
||||
FinanceChange,
|
||||
FinanceChangeDetail,
|
||||
FinanceDeleteBonusChange,
|
||||
FinanceEditBonusChange
|
||||
} from '@/api/calibration/salaryBonusAdjustment'
|
||||
import { deepCloneByJSON } from '@/utils/auxiliaryFunction'
|
||||
|
||||
defineOptions({
|
||||
name: 'Role',
|
||||
@@ -237,6 +234,7 @@ const drawerSize = computed(() => (appStore.device === DeviceEnum.DESKTOP ? '600
|
||||
|
||||
// 角色表单
|
||||
const formData = reactive<any>({
|
||||
id: '',
|
||||
username: '',
|
||||
type: '',
|
||||
Instructions: '',
|
||||
@@ -295,15 +293,17 @@ function handleSelectionChange(selection: any) {
|
||||
}
|
||||
|
||||
// 打开角色弹窗
|
||||
function handleOpenDialog(roleId?: string) {
|
||||
function handleOpenDialog(data: any = null) {
|
||||
dialog.visible = true
|
||||
if (roleId) {
|
||||
dialog.title = '修改角色'
|
||||
RoleAPI.getFormData(roleId).then((data) => {
|
||||
Object.assign(formData, data)
|
||||
})
|
||||
if (data) {
|
||||
dialog.title = '修改工资/奖金变更'
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
} else {
|
||||
dialog.title = '新增角色'
|
||||
dialog.title = '新增工资/奖金变更'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ function handleSubmit() {
|
||||
loading.value = true
|
||||
const roleId = formData.id
|
||||
if (roleId) {
|
||||
RoleAPI.update(roleId, formData)
|
||||
FinanceEditBonusChange(formData)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleCloseDialog()
|
||||
@@ -354,7 +354,7 @@ const onUserDeleteDepartment = (id: string) => {
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
UserDeleteDepartment(id)
|
||||
FinanceDeleteBonusChange(id)
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
handleResetQuery()
|
||||
@@ -366,58 +366,6 @@ const onUserDeleteDepartment = (id: string) => {
|
||||
}
|
||||
)
|
||||
}
|
||||
// 删除角色
|
||||
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('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// 打开分配菜单权限弹窗
|
||||
// async function handleOpenAssignPermDialog(row: RolePageVO) {
|
||||
// const roleId = row.id;
|
||||
// if (roleId) {
|
||||
// assignPermDialogVisible.value = true;
|
||||
// loading.value = true;
|
||||
//
|
||||
// checkedRole.value.id = roleId;
|
||||
// checkedRole.value.name = row.name;
|
||||
//
|
||||
// // 获取所有的菜单
|
||||
// menuPermOptions.value = await MenuAPI.getOptions();
|
||||
//
|
||||
// // 回显角色已拥有的菜单
|
||||
// RoleAPI.getRoleMenuIds(roleId)
|
||||
// .then((data) => {
|
||||
// const checkedMenuIds = data;
|
||||
// checkedMenuIds.forEach((menuId) => permTreeRef.value!.setChecked(menuId, true, false));
|
||||
// })
|
||||
// .finally(() => {
|
||||
// loading.value = false;
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// 分配菜单权限提交
|
||||
function handleAssignPermSubmit() {
|
||||
|
||||
@@ -99,28 +99,58 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="用户名" prop="account" />
|
||||
<el-table-column label="昵称" align="center" prop="username" />
|
||||
<el-table-column label="用户名" prop="account" min-width="120">
|
||||
<template #default="scope">
|
||||
{{ scope.row.account || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="昵称" align="center" prop="username" min-width="120">
|
||||
<template #default="scope">
|
||||
{{ scope.row.username || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="性别" width="100" align="center">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <DictLabel v-model="scope.row.gender" code="gender" />-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="部门" align="center" prop="department" />
|
||||
<el-table-column label="手机号码" align="center" prop="mobilePhone" />
|
||||
<el-table-column label="入职时间" align="center" prop="Dateofjoining" />
|
||||
<el-table-column label="操作" fixed="right" align="center" width="220">
|
||||
<el-table-column label="部门" align="center" prop="department" min-width="150">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.department && Array.isArray(scope.row.department) && scope.row.department.length > 0">
|
||||
{{ scope.row.department.map((d: any) => d.username || d.name || '').filter((n: string) => n).join(', ') }}
|
||||
</span>
|
||||
<span v-else-if="scope.row.department && typeof scope.row.department === 'string'">
|
||||
{{ scope.row.department }}
|
||||
</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="角色" align="center" prop="role">
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
v-for="(role, index) in scope.row.role"
|
||||
:key="index"
|
||||
type="primary"
|
||||
size="small"
|
||||
style="margin-right: 5px"
|
||||
>
|
||||
{{ role.RoleName }}
|
||||
</el-tag>
|
||||
<span v-if="!scope.row.role || scope.row.role.length === 0">-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手机号码" align="center" prop="mobilePhone" min-width="120">
|
||||
<template #default="scope">
|
||||
{{ scope.row.mobilePhone || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入职时间" align="center" prop="Dateofjoining" min-width="120">
|
||||
<template #default="scope">
|
||||
{{ scope.row.Dateofjoining || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="280">
|
||||
<template #default="scope">
|
||||
<!-- <el-button-->
|
||||
<!-- v-hasPerm="'sys:user:reset-password'"-->
|
||||
<!-- type="primary"-->
|
||||
<!-- icon="RefreshLeft"-->
|
||||
<!-- size="small"-->
|
||||
<!-- link-->
|
||||
<!-- @click="handleResetPassword(scope.row)"-->
|
||||
<!-- >-->
|
||||
<!-- 重置密码-->
|
||||
<!-- </el-button>-->
|
||||
<el-button
|
||||
v-hasPerm="'sys:user:edit'"
|
||||
type="primary"
|
||||
@@ -131,6 +161,16 @@
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPerm="'sys:user:assign-role'"
|
||||
type="warning"
|
||||
icon="User"
|
||||
link
|
||||
size="small"
|
||||
@click="handleAssignRole(scope.row)"
|
||||
>
|
||||
分配权限
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPerm="'sys:user:delete'"
|
||||
type="danger"
|
||||
@@ -184,11 +224,35 @@
|
||||
<el-input v-model="formData.mobilePhone" placeholder="请输入手机号" maxlength="11" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属部门" prop="department">
|
||||
<el-select v-model="formData.department" placeholder="请选择所属部门">
|
||||
<el-option key="行政部" label="行政部" value="行政部" />
|
||||
<el-option key="财务部" label="财务部" value="财务部" />
|
||||
<el-option key="执业律师" label="执业律师" value="执业律师" />
|
||||
<el-option key="实习律师" label="实习律师" value="实习律师" />
|
||||
<el-select
|
||||
v-model="formData.department"
|
||||
placeholder="请选择所属部门"
|
||||
multiple
|
||||
filterable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="dept in deptOptions"
|
||||
:key="dept.value"
|
||||
:label="dept.label"
|
||||
:value="dept.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色" prop="role">
|
||||
<el-select
|
||||
v-model="formData.role"
|
||||
placeholder="请选择角色"
|
||||
multiple
|
||||
filterable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="role in roleOptions"
|
||||
:key="role.value"
|
||||
:label="role.label"
|
||||
:value="role.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位" prop="position">
|
||||
@@ -360,6 +424,42 @@
|
||||
|
||||
<!-- 用户导入 -->
|
||||
<UserImport v-model="importDialogVisible" @import-success="handleQuery()" />
|
||||
|
||||
<!-- 分配权限对话框 -->
|
||||
<el-dialog
|
||||
v-model="assignRoleDialog.visible"
|
||||
title="分配权限"
|
||||
width="500px"
|
||||
@close="handleCloseAssignRoleDialog"
|
||||
>
|
||||
<el-form ref="assignRoleFormRef" :model="assignRoleForm" label-width="100px">
|
||||
<el-form-item label="用户姓名">
|
||||
<el-input v-model="assignRoleForm.username" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="角色" required>
|
||||
<el-select
|
||||
v-model="assignRoleForm.role"
|
||||
placeholder="请选择角色"
|
||||
multiple
|
||||
filterable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="role in assignRoleOptions"
|
||||
:key="role.value"
|
||||
:label="role.label"
|
||||
:value="role.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="handleSubmitAssignRole">确 定</el-button>
|
||||
<el-button @click="handleCloseAssignRoleDialog">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -394,8 +494,10 @@ import UserImport from './components/UserImport.vue'
|
||||
import {
|
||||
UserCreateUser,
|
||||
UserEditorialStaff,
|
||||
UserPersonnelList
|
||||
UserPersonnelList,
|
||||
getUserRoleOptions
|
||||
} from '@/api/calibration/personnelManagement'
|
||||
import { BusinessDisplayRole } from '@/api/calibration/roleManagement'
|
||||
import { convertFilePathsToObject } from '@/utils/auxiliaryFunction'
|
||||
|
||||
// ==================== 组件配置 ====================
|
||||
@@ -440,7 +542,8 @@ const formData = reactive<any>({
|
||||
password: '',
|
||||
nation: '',
|
||||
IdCard: '',
|
||||
department: '',
|
||||
department: [],
|
||||
role: [],
|
||||
mobilePhone: '',
|
||||
position: '',
|
||||
team: '',
|
||||
@@ -467,6 +570,20 @@ const roleOptions = ref<OptionType[]>()
|
||||
// 导入弹窗
|
||||
const importDialogVisible = ref(false)
|
||||
|
||||
// 分配权限对话框
|
||||
const assignRoleDialog = reactive({
|
||||
visible: false,
|
||||
userId: null as number | null
|
||||
})
|
||||
|
||||
const assignRoleForm = reactive({
|
||||
username: '',
|
||||
role: [] as number[]
|
||||
})
|
||||
|
||||
const assignRoleOptions = ref<OptionType[]>([])
|
||||
const assignRoleFormRef = ref()
|
||||
|
||||
// ==================== 计算属性 ====================
|
||||
|
||||
/**
|
||||
@@ -584,13 +701,21 @@ const rules = reactive({
|
||||
* 获取列表数据
|
||||
*/
|
||||
const fetchUserList = useDebounceFn(async () => {
|
||||
if (!queryParams.department) return
|
||||
// 如果没有选择部门,可以加载所有用户或者提示选择部门
|
||||
// 暂时允许不选择部门时也加载数据
|
||||
// if (!queryParams.department) return
|
||||
|
||||
loading.value = true
|
||||
try {
|
||||
const res: any = await UserPersonnelList(queryParams)
|
||||
pageData.value = res.data
|
||||
total.value = res.total
|
||||
pageData.value = res.data || []
|
||||
total.value = res.total || 0
|
||||
|
||||
// 调试:打印数据查看结构
|
||||
if (pageData.value.length > 0) {
|
||||
console.log('用户列表数据示例:', pageData.value[0])
|
||||
console.log('部门数据:', pageData.value[0]?.department)
|
||||
}
|
||||
} catch (error) {
|
||||
ElMessage.error('获取用户列表失败')
|
||||
console.error('获取用户列表失败:', error)
|
||||
@@ -657,10 +782,18 @@ async function handleOpenDialog(data?: any): Promise<void> {
|
||||
|
||||
// 并行加载下拉选项数据
|
||||
try {
|
||||
;[roleOptions.value, deptOptions.value] = await Promise.all([
|
||||
RoleAPI.getOptions(),
|
||||
const [roleRes, deptRes] = await Promise.all([
|
||||
BusinessDisplayRole({ RoleName: '' }),
|
||||
DeptAPI.getOptions()
|
||||
])
|
||||
|
||||
// 转换角色数据格式
|
||||
roleOptions.value = (roleRes.data || []).map((role: any) => ({
|
||||
label: role.RoleName,
|
||||
value: parseInt(role.id)
|
||||
}))
|
||||
|
||||
deptOptions.value = deptRes || []
|
||||
} catch (error) {
|
||||
ElMessage.error('加载选项数据失败')
|
||||
console.error('加载选项数据失败:', error)
|
||||
@@ -673,6 +806,20 @@ async function handleOpenDialog(data?: any): Promise<void> {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
data1.academic = parseJsonToArray(data1.academic)
|
||||
|
||||
// 处理部门数据
|
||||
if (data1.department && Array.isArray(data1.department)) {
|
||||
data1.department = data1.department.map((d: any) => d.id)
|
||||
} else {
|
||||
data1.department = []
|
||||
}
|
||||
|
||||
// 处理角色数据
|
||||
if (data1.role && Array.isArray(data1.role)) {
|
||||
data1.role = data1.role.map((r: any) => parseInt(r.id))
|
||||
} else {
|
||||
data1.role = []
|
||||
}
|
||||
|
||||
data1.AcademicResume = convertFilePathsToObject(JSON.parse(data1.AcademicResume))[0]
|
||||
data1.contract = convertFilePathsToObject(JSON.parse(data1.contract))[0]
|
||||
data1.ApplicationForm = convertFilePathsToObject(JSON.parse(data1.ApplicationForm))[0]
|
||||
@@ -684,6 +831,9 @@ async function handleOpenDialog(data?: any): Promise<void> {
|
||||
} else {
|
||||
// 新增:设置默认值
|
||||
dialog.title = '新增用户'
|
||||
// 重置表单数据
|
||||
formData.department = []
|
||||
formData.role = []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -726,6 +876,82 @@ function handleCloseDialog(): void {
|
||||
|
||||
// 重置表单数据
|
||||
formData.id = undefined
|
||||
formData.department = []
|
||||
formData.role = []
|
||||
}
|
||||
|
||||
/**
|
||||
* 分配用户角色/权限
|
||||
*/
|
||||
async function handleAssignRole(row: any): Promise<void> {
|
||||
try {
|
||||
// 加载角色列表
|
||||
const roleRes = await BusinessDisplayRole({ RoleName: '' })
|
||||
assignRoleOptions.value = (roleRes.data || []).map((role: any) => ({
|
||||
label: role.RoleName,
|
||||
value: parseInt(role.id)
|
||||
}))
|
||||
|
||||
// 设置表单数据
|
||||
assignRoleForm.username = row.username
|
||||
assignRoleForm.role = row.role && Array.isArray(row.role)
|
||||
? row.role.map((r: any) => parseInt(r.id))
|
||||
: []
|
||||
assignRoleDialog.userId = row.id
|
||||
assignRoleDialog.visible = true
|
||||
} catch (error) {
|
||||
ElMessage.error('加载角色列表失败')
|
||||
console.error('加载角色列表失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交权限分配
|
||||
*/
|
||||
async function handleSubmitAssignRole(): Promise<void> {
|
||||
if (!assignRoleDialog.userId) {
|
||||
ElMessage.error('用户ID不存在')
|
||||
return
|
||||
}
|
||||
|
||||
loading.value = true
|
||||
try {
|
||||
// 获取用户完整数据
|
||||
const userData = pageData.value.find((u: any) => u.id === assignRoleDialog.userId)
|
||||
if (!userData) {
|
||||
ElMessage.error('用户不存在')
|
||||
return
|
||||
}
|
||||
|
||||
// 构建更新数据
|
||||
const updateData = {
|
||||
...userData,
|
||||
role: assignRoleForm.role
|
||||
}
|
||||
|
||||
await UserEditorialStaff(updateData)
|
||||
ElMessage.success('权限分配成功')
|
||||
handleCloseAssignRoleDialog()
|
||||
handleQuery() // 刷新列表
|
||||
} catch (error) {
|
||||
ElMessage.error('权限分配失败')
|
||||
console.error('权限分配失败:', error)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭分配权限对话框
|
||||
*/
|
||||
function handleCloseAssignRoleDialog(): void {
|
||||
assignRoleDialog.visible = false
|
||||
assignRoleDialog.userId = null
|
||||
assignRoleForm.username = ''
|
||||
assignRoleForm.role = []
|
||||
if (assignRoleFormRef.value) {
|
||||
assignRoleFormRef.value.resetFields()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -823,7 +1049,6 @@ function handleDelete(id?: string | number): void {
|
||||
function handleFileSelect(file: any, field: string): void {
|
||||
// 将文件对象保存到表单数据中
|
||||
formData[field] = file.raw // file.raw 是实际的 File 对象
|
||||
console.log(formData[field])
|
||||
userFormRef.value.clearValidate(field)
|
||||
ElMessage.success('文件选择成功')
|
||||
}
|
||||
|
||||
@@ -44,11 +44,20 @@ export default defineConfig(({ mode }: ConfigEnv) => {
|
||||
port: +(env.VITE_APP_PORT as string),
|
||||
open: true,
|
||||
proxy: {
|
||||
// 代理 /api2 的请求到后端服务器
|
||||
'/api2': {
|
||||
changeOrigin: true,
|
||||
target: 'http://199.168.137.123:8000',
|
||||
rewrite: (path: string) => {
|
||||
return path.replace(/^\/api2/, '/api2')
|
||||
}
|
||||
},
|
||||
// 代理 /dev-api/api2 的请求(兼容旧配置)
|
||||
'/dev-api/api2': {
|
||||
changeOrigin: true,
|
||||
target: 'http://192.168.31.69:8006',
|
||||
target: 'http://199.168.137.123:8000',
|
||||
rewrite: (path: string) => {
|
||||
return path.replace(/^\/dev-api\/api2/, '')
|
||||
return path.replace(/^\/dev-api\/api2/, '/api2')
|
||||
}
|
||||
},
|
||||
// 代理 /dev-api 的请求
|
||||
|
||||
Reference in New Issue
Block a user