ljlong_2630
7 months ago
417 changed files with 22037 additions and 4304 deletions
@ -0,0 +1,48 @@ |
|||
# 生产环境 |
|||
NODE_ENV=test |
|||
|
|||
VITE_DEV=false |
|||
|
|||
# 请求路径 |
|||
VITE_BASE_URL='http://192.168.0.108:12080' |
|||
# 上传路径 |
|||
VITE_UPLOAD_URL='http://192.168.0.108:12080/admin-api/infra/file/upload' |
|||
|
|||
# # 请求路径 |
|||
# VITE_BASE_URL='http://dev.ccwin-in.com:25300/api' |
|||
|
|||
# # 上传路径 |
|||
# VITE_UPLOAD_URL='http://dev.ccwin-in.com:25300/api/admin-api/infra/file/upload' |
|||
|
|||
# 接口前缀 |
|||
VITE_API_BASEPATH= |
|||
|
|||
# 接口地址 |
|||
VITE_API_URL=/admin-api |
|||
|
|||
# 是否删除debugger |
|||
VITE_DROP_DEBUGGER=true |
|||
|
|||
# 是否删除console.log |
|||
VITE_DROP_CONSOLE=true |
|||
|
|||
# 是否sourcemap |
|||
VITE_SOURCEMAP=false |
|||
|
|||
# 打包路径 |
|||
VITE_BASE_PATH=/ |
|||
|
|||
# 输出路径 |
|||
VITE_OUT_DIR=sfms3.0 |
|||
|
|||
# 自定义接口路径 |
|||
VITE_INTERFACE_URL='http://192.168.0.108:12080/magic/web/index.html' |
|||
|
|||
# 积木报表请求路径 |
|||
VITE_JMREPORT_BASE_URL='http://192.168.0.108:12080' |
|||
|
|||
# # 自定义接口路径 |
|||
# VITE_INTERFACE_URL='http://dev.ccwin-in.com:25310/magic/web/index.html' |
|||
|
|||
# # 积木报表请求路径 |
|||
# VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25310' |
@ -0,0 +1,53 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface HolidayVO { |
|||
id: number |
|||
status: string |
|||
remark: string |
|||
holidayYear: string |
|||
holidayType: string |
|||
keyDate: string |
|||
holidayName: string |
|||
holidayDate: Date |
|||
} |
|||
|
|||
// 查询节假日设置列表
|
|||
export const getHolidayPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/mes/holiday/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/mes/holiday/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询节假日设置详情
|
|||
export const getHoliday = async (id: number) => { |
|||
return await request.get({ url: `/mes/holiday/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增节假日设置
|
|||
export const createHoliday = async (data: HolidayVO) => { |
|||
return await request.post({ url: `/mes/holiday/create`, data }) |
|||
} |
|||
|
|||
// 修改节假日设置
|
|||
export const updateHoliday = async (data: HolidayVO) => { |
|||
return await request.put({ url: `/mes/holiday/update`, data }) |
|||
} |
|||
|
|||
// 删除节假日设置
|
|||
export const deleteHoliday = async (id: number) => { |
|||
return await request.delete({ url: `/mes/holiday/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出节假日设置 Excel
|
|||
export const exportHoliday = async (params) => { |
|||
return await request.download({ url: `/mes/holiday/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/mes/holiday/get-import-template' }) |
|||
} |
@ -0,0 +1,57 @@ |
|||
import request from '@/config/axios' |
|||
export interface OrderDayQueryParamVo { |
|||
planNoDay:String |
|||
productCode:String |
|||
workroomCode:String |
|||
lineCode:String |
|||
processrouteCode:String |
|||
batchCode:String |
|||
processCode:String |
|||
} |
|||
|
|||
|
|||
// 查询生产配置工艺路线
|
|||
export const getConfigProcessRoute = async (params) => { |
|||
return await request.get({ url: `/mes/orderDayRoute/getByOrder`, params }) |
|||
} |
|||
// 查询已经配置的工序
|
|||
export const getConfigProcessRouteNode = async (params) => { |
|||
return await request.get({ url: `/mes/orderDayRoutesub/getByOrder`, params }) |
|||
} |
|||
// 查询生产配置工序BOM
|
|||
export const getOrderDayBomByOrder = async (params) => { |
|||
return await request.get({ url: `/mes/orderDayBom/getByOrder`, params }) |
|||
} |
|||
|
|||
// 查询已经配置工序工位
|
|||
export const getConfigProcessWorkstation = async (params) => { |
|||
return await request.get({ url: `/mes/orderDayWorkstation/getByOrder`, params }) |
|||
} |
|||
// 查询已经配置工序人员
|
|||
export const getConfigProcessWorker = async (params) => { |
|||
return await request.get({ url: `/mes/orderDayWorker/getByOrder`, params }) |
|||
} |
|||
// 查询已经的工序工位设备
|
|||
export const getConfigProcessEquipment = async (params) => { |
|||
return await request.get({ url: `/mes/orderDayequipment/getByOrder`, params }) |
|||
} |
|||
|
|||
/*批量保存工序人员配置*/ |
|||
export const saveWorker = async (data: any) => { |
|||
return await request.post({ url: `/mes/orderDayWorker/batchCreate`, data }) |
|||
} |
|||
|
|||
// 查询设备基本信息列表
|
|||
export const getDeviceInfoPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/mes/device-info/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/mes/device-info/page`, params }) |
|||
} |
|||
} |
|||
/*批量保存工序模具配置*/ |
|||
export const saveEquipment = async (data: any) => { |
|||
return await request.post({ url: `/mes/orderDayequipment/batchCreate`, data }) |
|||
} |
@ -0,0 +1,158 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface ProcessVO { |
|||
code: string |
|||
name: string |
|||
description: string |
|||
type: string |
|||
workshopCode: string |
|||
productionLineCode: string |
|||
available: number |
|||
activeTime: Date |
|||
expireTime: Date |
|||
remark: string |
|||
} |
|||
|
|||
export const goalParams = { |
|||
processCode:null |
|||
} |
|||
// 查询工序列表
|
|||
export const getProcessPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return request.post({ url: '/mes/process/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/mes/process/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询工序详情
|
|||
export const getProcess = async (id: number) => { |
|||
return await request.get({ url: `/mes/process/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增工序
|
|||
export const createProcess: (data: ProcessVO) => Promise<any> = async (data: ProcessVO) => { |
|||
return await request.post({ url: `/mes/process/create`, data }) |
|||
} |
|||
|
|||
// 修改工序
|
|||
export const updateProcess = async (data: ProcessVO) => { |
|||
return await request.put({ url: `/mes/process/update`, data }) |
|||
} |
|||
|
|||
// 删除工序
|
|||
export const deleteProcess: (id: number) => Promise<any> = async (id: number) => { |
|||
return await request.delete({ url: `/mes/process/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出工序 Excel
|
|||
export const exportProcess = async (params) => { |
|||
if (params.isSearch) { |
|||
const data = {...params} |
|||
return await request.downloadPost({ url: `/mes/process/export-excel-senior`, data }) |
|||
} else { |
|||
return await request.download({ url: `/mes/process/export-excel`, params }) |
|||
} |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/mes/process/get-import-template' }) |
|||
} |
|||
|
|||
|
|||
// 查询模具基本信息列表
|
|||
export const getPatternPage = async (params) => { |
|||
params.processCode = goalParams.processCode |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return request.post({ url: '/mes/mes-process-pattern/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/mes/mes-process-pattern/pagePatternByProcessCode`, params }) |
|||
} |
|||
} |
|||
|
|||
//创建工序模具关联
|
|||
export const createPatternRelation = async (Codes:string[]) => { |
|||
const data = { |
|||
processCode : goalParams.processCode, |
|||
listPatternCode : Codes |
|||
} |
|||
return await request.post({ url: `/mes/mes-process-pattern/createRelation`, data }) |
|||
} |
|||
|
|||
//删除工序模具关联
|
|||
export const deletePatternRelation = async (Codes:string[]) => { |
|||
const data = { |
|||
processCode : goalParams.processCode, |
|||
listPatternCode : Codes |
|||
} |
|||
return await request.post({ url: `/mes/mes-process-pattern/deleteRelation`, data }) |
|||
} |
|||
|
|||
|
|||
|
|||
// 查询产线列表
|
|||
export const getProductionlinePage = async (params) => { |
|||
params.processCode = goalParams.processCode |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return request.post({ url: '/mes/mes-process-productionline/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/mes/mes-process-productionline/pageByProcessCode`, params }) |
|||
} |
|||
} |
|||
|
|||
//创建工序产线关联
|
|||
export const createProductionlineRelation = async (Codes:string[]) => { |
|||
const data = { |
|||
processCode : goalParams.processCode, |
|||
listProductionlineCode : Codes |
|||
} |
|||
return await request.post({ url: `/mes/mes-process-productionline/createRelation`, data }) |
|||
} |
|||
|
|||
//删除工序产线关联
|
|||
export const deleteProductionlineRelation = async (Codes:string[]) => { |
|||
const data = { |
|||
processCode : goalParams.processCode, |
|||
listProductionlineCode : Codes |
|||
} |
|||
return await request.post({ url: `/mes/mes-process-productionline/deleteRelation`, data }) |
|||
} |
|||
|
|||
|
|||
|
|||
// 查询物料列表
|
|||
export const getItembasicPage = async (params) => { |
|||
params.processCode = goalParams.processCode |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return request.post({ url: '/mes/mes-process-itembasic/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/mes/mes-process-itembasic/pageByProcessCode`, params }) |
|||
} |
|||
} |
|||
|
|||
//创建工序物料关联
|
|||
export const createItembasicRelation = async (Codes:string[]) => { |
|||
const data = { |
|||
processCode : goalParams.processCode, |
|||
listItembasicCode : Codes |
|||
} |
|||
return await request.post({ url: `/mes/mes-process-itembasic/createRelation`, data }) |
|||
} |
|||
|
|||
//删除工序物料关联
|
|||
export const deleteItembasicRelation = async (Codes:string[]) => { |
|||
const data = { |
|||
processCode : goalParams.processCode, |
|||
listItembasicCode : Codes |
|||
} |
|||
return await request.post({ url: `/mes/mes-process-itembasic/deleteRelation`, data }) |
|||
} |
@ -0,0 +1,59 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface ProductBacklineVO { |
|||
offlineCode: string |
|||
productCode: string |
|||
workBillno: string |
|||
processCode: string |
|||
operCode: string |
|||
backlineBillno: string |
|||
planCode: string |
|||
deleteTime: Date |
|||
id: number |
|||
status: string |
|||
remark: string |
|||
deleter: string |
|||
siteId: number |
|||
workstationCode: string |
|||
} |
|||
|
|||
// 查询产品返线登记列表
|
|||
export const getProductBacklinePage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/mes/product-backline/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/mes/product-backline/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询产品返线登记详情
|
|||
export const getProductBackline = async (id: number) => { |
|||
return await request.get({ url: `/mes/product-backline/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增产品返线登记
|
|||
export const createProductBackline = async (data: ProductBacklineVO) => { |
|||
return await request.post({ url: `/mes/product-backline/create`, data }) |
|||
} |
|||
|
|||
// 修改产品返线登记
|
|||
export const updateProductBackline = async (data: ProductBacklineVO) => { |
|||
return await request.put({ url: `/mes/product-backline/update`, data }) |
|||
} |
|||
|
|||
// 删除产品返线登记
|
|||
export const deleteProductBackline = async (id: number) => { |
|||
return await request.delete({ url: `/mes/product-backline/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出产品返线登记 Excel
|
|||
export const exportProductBackline = async (params) => { |
|||
return await request.download({ url: `/mes/product-backline/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/mes/product-backline/get-import-template' }) |
|||
} |
@ -0,0 +1,71 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface ProductOfflineVO { |
|||
offlineCode: string |
|||
workBillno: string |
|||
planCode: string |
|||
productCode: string |
|||
offlineReson: string |
|||
productDestination: string |
|||
deleteTime: Date |
|||
id: number |
|||
status: string |
|||
concurrencyStamp: number |
|||
remark: string |
|||
deleter: string |
|||
siteId: number |
|||
processCode: string |
|||
stationCode: string |
|||
checkPersonCode: string |
|||
} |
|||
|
|||
// 查询产品离线登记记录列表
|
|||
export const getProductOfflinePage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/mes/product-offline/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/mes/product-offline/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询产品离线登记记录详情
|
|||
export const getProductOffline = async (id: number) => { |
|||
return await request.get({ url: `/mes/product-offline/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增产品离线登记记录
|
|||
export const createProductOffline = async (data: ProductOfflineVO) => { |
|||
return await request.post({ url: `/mes/product-offline/create`, data }) |
|||
} |
|||
|
|||
// 修改产品离线登记记录
|
|||
export const updateProductOffline = async (data: ProductOfflineVO) => { |
|||
return await request.put({ url: `/mes/product-offline/update`, data }) |
|||
} |
|||
|
|||
// 删除产品离线登记记录
|
|||
export const deleteProductOffline = async (id: number) => { |
|||
return await request.delete({ url: `/mes/product-offline/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出产品离线登记记录 Excel
|
|||
export const exportProductOffline = async (params) => { |
|||
return await request.download({ url: `/mes/product-offline/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/mes/product-offline/get-import-template' }) |
|||
} |
|||
|
|||
export const getworkSchedulingPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/mes/work-scheduling/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/mes/work-scheduling/page`, params }) |
|||
} |
|||
} |
@ -0,0 +1,46 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface WorkSchedulingVO { |
|||
flagDo: string |
|||
} |
|||
|
|||
// 查询生产任务排产列表
|
|||
export const getWorkSchedulingPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/mes/work-scheduling/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/mes/work-scheduling/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询生产任务排产详情
|
|||
export const getWorkScheduling = async (id: number) => { |
|||
return await request.get({ url: `/mes/work-scheduling/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增生产任务排产
|
|||
export const createWorkScheduling = async (data: WorkSchedulingVO) => { |
|||
return await request.post({ url: `/mes/work-scheduling/create`, data }) |
|||
} |
|||
|
|||
// 修改生产任务排产
|
|||
export const updateWorkScheduling = async (data: WorkSchedulingVO) => { |
|||
return await request.put({ url: `/mes/work-scheduling/update`, data }) |
|||
} |
|||
|
|||
// 删除生产任务排产
|
|||
export const deleteWorkScheduling = async (id: number) => { |
|||
return await request.delete({ url: `/mes/work-scheduling/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出生产任务排产 Excel
|
|||
export const exportWorkScheduling = async (params) => { |
|||
return await request.download({ url: `/mes/work-scheduling/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/mes/work-scheduling/get-import-template' }) |
|||
} |
@ -0,0 +1,62 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface WorkSchedulingDetailVO { |
|||
schedulingCode: string |
|||
schedulingId: number |
|||
taskSort: number |
|||
nodeCode: string |
|||
workstationValidate: string |
|||
deviceValidate: string |
|||
personValidate: string |
|||
reportPerson: string |
|||
receivePerson: string |
|||
planCount: number |
|||
reportCount: number |
|||
reportType: number |
|||
qualifiedCount: number |
|||
unqualifiedCount: number |
|||
receiveWorkstation: string |
|||
receiveDevice: string |
|||
materialValidate: string |
|||
} |
|||
|
|||
// 查询工单任务明细列表
|
|||
export const getWorkSchedulingDetailPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/mes/work-scheduling-detail/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/mes/work-scheduling-detail/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询工单任务明细详情
|
|||
export const getWorkSchedulingDetail = async (id: number) => { |
|||
return await request.get({ url: `/mes/work-scheduling-detail/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增工单任务明细
|
|||
export const createWorkSchedulingDetail = async (data: WorkSchedulingDetailVO) => { |
|||
return await request.post({ url: `/mes/work-scheduling-detail/create`, data }) |
|||
} |
|||
|
|||
// 修改工单任务明细
|
|||
export const updateWorkSchedulingDetail = async (data: WorkSchedulingDetailVO) => { |
|||
return await request.put({ url: `/mes/work-scheduling-detail/update`, data }) |
|||
} |
|||
|
|||
// 删除工单任务明细
|
|||
export const deleteWorkSchedulingDetail = async (id: number) => { |
|||
return await request.delete({ url: `/mes/work-scheduling-detail/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出工单任务明细 Excel
|
|||
export const exportWorkSchedulingDetail = async (params) => { |
|||
return await request.download({ url: `/mes/work-scheduling-detail/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/mes/work-scheduling-detail/get-import-template' }) |
|||
} |
@ -0,0 +1,81 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
|
|||
|
|||
// 查询节假日
|
|||
export const getDismantlingDetailPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/mes/workCalendar/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/mes/workCalendar/page`, params }) |
|||
} |
|||
} |
|||
|
|||
//班组排班 信息
|
|||
export interface SchedulingcalendarCreateReqVO{ |
|||
keyDate:String, |
|||
//班组编码
|
|||
teamCode:String, |
|||
//班组名称
|
|||
teamName:String, |
|||
//班组类别"
|
|||
teamType:String, |
|||
//班次名称"
|
|||
shiftName:String, |
|||
//班次编码
|
|||
shiftCode:String, |
|||
//上班时间
|
|||
startTime:String, |
|||
//下班时间"
|
|||
endTime:String, |
|||
//工作日期
|
|||
workDate:String, |
|||
//倒班规则
|
|||
shiftRule:String, |
|||
//倒班类型
|
|||
shiftRate:String, |
|||
sort:number |
|||
} |
|||
//
|
|||
// 查询班组列表
|
|||
export const getTeamList = async (params) => { |
|||
return await request.get({ url: `/wms/team/page`, params }) |
|||
} |
|||
|
|||
// 保存排班信息
|
|||
export const saveWorkPlan = async (data:SchedulingcalendarCreateReqVO ) => { |
|||
return await request.post({ url: `/mes/schedulingcalendar/create`, data }) |
|||
} |
|||
// 删除班组排班信息
|
|||
export const deleteWorkPlan = async (data) => { |
|||
return await request.post({ url: `/mes/schedulingcalendar/deleteTeam`, data}) |
|||
} |
|||
//批量保存排班信息
|
|||
export const createBatch = async (data:any) => { |
|||
return await request.post({ url: `/mes/schedulingcalendar/createBatch`, data }) |
|||
} |
|||
//批量对象方式保存排班信息--保留
|
|||
export const createObj= async (data:any) => { |
|||
return await request.post({ url: `/mes/schedulingcalendar/createObj`, data }) |
|||
} |
|||
|
|||
// 查询排班信息 code startTime:开始时间" endTime:结束时间")
|
|||
export const getWorkPlan = async (params ) => { |
|||
return await request.get({ url: `/mes/schedulingcalendar/getList`,params }) |
|||
} |
|||
// 查询班次信息
|
|||
export const getShiftInfos = async (code:any) => { |
|||
return await request.get({ url: `/mes/schedulingcalendar/shift?code=`+code}) |
|||
} |
|||
//查询节假日信息
|
|||
export const getHolidays = async (year:any) => { |
|||
return await request.get({ url: `/mes/holiday/listByYear?year=`+year}) |
|||
} |
|||
|
|||
// 导出排班信息
|
|||
export const exportWorkPlan = async (params) => { |
|||
return await request.download({ url: `/mes/schedulingcalendar/export-excel`, params }) |
|||
} |
|||
|
@ -0,0 +1,13 @@ |
|||
import request from '@/config/axios' |
|||
export interface InspectionRequestPackageVO { |
|||
number: string |
|||
packageCode: string |
|||
packageSpecificationCode: string |
|||
amount: string |
|||
measuringUnit: string |
|||
} |
|||
|
|||
//查询包装列表
|
|||
export const getInspectionJobPackageList = async (id: number) => { |
|||
return await request.get({ url: `/qms/inspection-job-package/list?masterId=` + id }) |
|||
} |
@ -0,0 +1,13 @@ |
|||
import request from '@/config/axios' |
|||
export interface InspectionRequestPackageVO { |
|||
number: string |
|||
packageCode: string |
|||
packageSpecificationCode: string |
|||
amount: string |
|||
measuringUnit: string |
|||
} |
|||
|
|||
//查询包装列表
|
|||
export const getInspectionRecordPackageList = async (id: number) => { |
|||
return await request.get({ url: `/qms/inspection-record-package/list?masterId=` + id }) |
|||
} |
@ -0,0 +1,27 @@ |
|||
import request from '@/config/axios' |
|||
export interface InspectionRequestPackageVO { |
|||
number: string |
|||
packageCode: string |
|||
packageSpecificationCode: string |
|||
amount: string |
|||
measuringUnit: string |
|||
} |
|||
|
|||
//查询包装列表
|
|||
export const getInspectionRequestPackageList = async (id: number) => { |
|||
return await request.get({ url: `/qms/inspection-request-package/list?masterId=` + id }) |
|||
} |
|||
// 新增检验申请
|
|||
export const createInspectionRequestPackage = async (data: InspectionRequestPackageVO) => { |
|||
return await request.post({ url: `/qms/inspection-request-package/create`, data }) |
|||
} |
|||
|
|||
// 修改检验申请
|
|||
export const updateInspectionRequestPackage = async (data: InspectionRequestPackageVO) => { |
|||
return await request.put({ url: `/qms/inspection-request-package/update`, data }) |
|||
} |
|||
|
|||
// 删除检验申请
|
|||
export const deleteInspectionRequestPackage = async (id: number) => { |
|||
return await request.delete({ url: `/qms/inspection-request-package/delete?id=` + id }) |
|||
} |
@ -0,0 +1,57 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface InterfaceInfoVO { |
|||
number:string |
|||
id: number |
|||
interfaceType: string |
|||
interfaceName: string |
|||
interfaceStatus: string |
|||
url: string |
|||
reqBody: string |
|||
respBody: string |
|||
errorMsg: string |
|||
remark: string |
|||
extraProperties: string |
|||
concurrencyStamp: number |
|||
} |
|||
|
|||
// 查询接口调用信息列表
|
|||
export const getInterfaceInfoPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/wms/interface-info/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/wms/interface-info/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询接口调用信息详情
|
|||
export const getInterfaceInfo = async (id: number) => { |
|||
return await request.get({ url: `/wms/interface-info/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增接口调用信息
|
|||
export const createInterfaceInfo = async (data: InterfaceInfoVO) => { |
|||
return await request.post({ url: `/wms/interface-info/create`, data }) |
|||
} |
|||
|
|||
// 修改接口调用信息
|
|||
export const updateInterfaceInfo = async (data: InterfaceInfoVO) => { |
|||
return await request.put({ url: `/wms/interface-info/update`, data }) |
|||
} |
|||
|
|||
// 删除接口调用信息
|
|||
export const deleteInterfaceInfo = async (id: number) => { |
|||
return await request.delete({ url: `/wms/interface-info/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出接口调用信息 Excel
|
|||
export const exportInterfaceInfo = async (params) => { |
|||
return await request.download({ url: `/wms/interface-info/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/wms/interface-info/get-import-template' }) |
|||
} |
After Width: | Height: | Size: 1.0 KiB |
@ -1,40 +1,202 @@ |
|||
<template> |
|||
<div> |
|||
<Dialog v-model="isPackageShow" :title="dialogTitle" :width="width?width:'900px'" v-loading="packageLoading"> |
|||
<Dialog |
|||
v-model="isPackageShow" |
|||
:title="dialogTitle" |
|||
:width="width ? width : '900px'" |
|||
v-loading="packageLoading" |
|||
> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
:masterId="masterParmas.masterId" |
|||
@button-base-click="buttonBaseClick" |
|||
:allSchemas="detailAllSchemas" |
|||
/> |
|||
<Table |
|||
ref="searchTableRef" |
|||
:columns="columns" |
|||
:data="allList" |
|||
:reserveSelection="true" |
|||
row-key="id" |
|||
/> |
|||
> |
|||
<template #action="{ row }"> |
|||
<ButtonBase |
|||
:Butttondata="butttondata" |
|||
@button-base-click="buttonTableClick($event, row)" |
|||
/> |
|||
</template> |
|||
</Table> |
|||
</Dialog> |
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="formRef" |
|||
:rules="detailAllSchemasRules" |
|||
:formAllSchemas="detailAllSchemas" |
|||
:isBusiness="false" |
|||
:apiUpdate="apiUpdate" |
|||
:apiCreate="apiCreate" |
|||
:isDetail="true" |
|||
:detailData="detailData" |
|||
@success="submitForm" |
|||
/> |
|||
</div> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
|
|||
const isPackageShow = ref(false) |
|||
const packageLoading = ref(false) |
|||
const dialogTitle = ref() |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
const message = useMessage() // 消息弹窗 |
|||
const columns = ref() |
|||
const allList = ref() |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
// 接受父组件参数 |
|||
const props = defineProps({ |
|||
width: { |
|||
type: String, |
|||
required: false |
|||
}, |
|||
// 明细列表相关信息 |
|||
detailAllSchemas: { |
|||
type: Object, |
|||
required: true, |
|||
default: null |
|||
}, |
|||
// 明细验证 |
|||
detailAllSchemasRules: { |
|||
type: Object, |
|||
required: true, |
|||
default: null |
|||
}, |
|||
// 子表新增API |
|||
apiCreate: { |
|||
type: Function, |
|||
required: false, |
|||
default: null |
|||
}, |
|||
// 子表编辑API |
|||
apiUpdate: { |
|||
type: Function, |
|||
required: false, |
|||
default: null |
|||
}, |
|||
// 子表新增修改校验 |
|||
detailValidate: { |
|||
type: Function, |
|||
required: false, |
|||
default: null |
|||
}, |
|||
// 子列表 删除 展示与隐藏 ,默认展示 |
|||
detailButtonIsShowDelete: { |
|||
type: Boolean, |
|||
required: false, |
|||
default: true |
|||
}, |
|||
// 列表 |
|||
list: { |
|||
type: Object, |
|||
required: true, |
|||
default: null |
|||
} |
|||
}) |
|||
|
|||
const isPackageShow = ref(false) |
|||
const packageLoading = ref(false) |
|||
const dialogTitle = ref() |
|||
const columns = ref() |
|||
const allList = ref([]) |
|||
|
|||
//主表所需的参数 |
|||
const masterParmas = ref({ |
|||
masterId: '', //主表id |
|||
number: '' //主表单据号 |
|||
}) |
|||
const openPackage = async (row?: any, titleName?: any,tableColumns?: any,list?: any) => { |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = ref() |
|||
// 列表-操作按钮 |
|||
const butttondata = ref() |
|||
const detailData = ref({}) |
|||
const openPackage = async (row?: any, titleName?: any, tableColumns?: any, list?: any) => { |
|||
isPackageShow.value = true |
|||
detailData.value = row |
|||
masterParmas.value.masterId = row.masterId || row.id |
|||
masterParmas.value.number = row.number |
|||
if(detailData.value.status ==1){ |
|||
HeadButttondata.value = [ |
|||
defaultButtons.defaultAddBtn(null) // 新增 |
|||
] |
|||
butttondata.value =[ |
|||
defaultButtons.mainListEditBtn(null), // 编辑 |
|||
defaultButtons.mainListDeleteBtn(null) //删除 |
|||
] |
|||
columns.value = tableColumns |
|||
}else{ |
|||
columns.value = tableColumns.filter(item=>item.field != 'action') |
|||
|
|||
} |
|||
if (titleName) { |
|||
dialogTitle.value = titleName |
|||
} |
|||
columns.value = tableColumns.filter(item => (item.field !== 'action')) |
|||
allList.value = list |
|||
} |
|||
defineExpose({ openPackage }) // 提供 open 方法,用于打开弹窗 |
|||
|
|||
// 根据状态返回该按钮是否显示 |
|||
const isShowMainButton = (row, val) => { |
|||
if (val.indexOf(row.status) > -1) { |
|||
return false |
|||
} else { |
|||
return true |
|||
} |
|||
} |
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { |
|||
// 新增 |
|||
openForm('create') |
|||
} |
|||
} |
|||
/** 添加/修改操作 */ |
|||
const formRef = ref() |
|||
const openForm = async (type: string, row?: number) => { |
|||
formRef.value.open(type, row, masterParmas.value) |
|||
} |
|||
const submitForm = async (formType, data) => { |
|||
try { |
|||
// 子表新增编辑校验 如果业务需要子表提交校验 需在主页详情组件添加 detailValidate 参数及方法 |
|||
const rs = (await props.detailValidate) ? await props.detailValidate(data) : true |
|||
if (!rs) return |
|||
emit('ListTableSubmit', formType, data) |
|||
// 刷新当前列表 |
|||
} finally { |
|||
formRef.value.formLoading = false |
|||
} |
|||
} |
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { |
|||
// 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { |
|||
// 删除 |
|||
handleDelete(row) |
|||
} |
|||
} |
|||
const handleDelete = async (row: any) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
emit('ListTableSubmit', 'detele', row) |
|||
} catch {} |
|||
} |
|||
const emit = defineEmits(['ListTableSubmit']) // 定义 success 事件,用于操作成功后的回调 |
|||
defineExpose({ openPackage, formRef }) // 提供 open 方法,用于打开弹窗 |
|||
watch( |
|||
() => props.list, |
|||
(newValue) => { |
|||
allList.value = newValue |
|||
formRef.value.dialogVisible = false |
|||
}, |
|||
{ |
|||
deep: true |
|||
} |
|||
) |
|||
</script> |
|||
|
|||
|
@ -0,0 +1,21 @@ |
|||
import type { App } from 'vue' |
|||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|||
|
|||
const { t } = useI18n() // 国际化
|
|||
|
|||
export function clientTable(app: App<Element>) { |
|||
app.directive('clientTable', (el, binding) => { |
|||
nextTick(() => { |
|||
const top = el.getBoundingClientRect().top |
|||
////--top-tool-height:50 --tags-view-height:35
|
|||
const qustionHeight = 20 |
|||
let paginationHeight = 0 |
|||
if(el.children&&el.children.length>1){ |
|||
paginationHeight = 70 |
|||
} |
|||
const height = window.innerHeight - top - paginationHeight - qustionHeight |
|||
el.style.height = height + 'px' |
|||
el.firstChild.style.height = '100%' |
|||
}) |
|||
}) |
|||
} |
@ -0,0 +1,85 @@ |
|||
<template> |
|||
<div v-loading="loading" class="box"> |
|||
<el-form ref="formSmsLogin" :model="loginData" :rules="rules" label-width="130px" label-position="top" size="large"> |
|||
<div class="title">忘记密码</div> |
|||
<el-row type="flex" justify="center" align="middle"> |
|||
<el-col> |
|||
<el-form-item label="用户名" prop="username" align="center"> |
|||
<el-input v-model="loginData.username" placeholder="请输入用户名" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col> |
|||
<el-form-item label="邮箱" prop="email"> |
|||
<el-input v-model="loginData.email" placeholder="请输入邮箱" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<div class="dialog-footer"> |
|||
<el-button type="primary" @click="submitForm" style="width: 100%;height: 40px;line-height: 40px;">确 定</el-button> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
<script lang="ts" setup name="forgetPassword"> |
|||
import type { RouteLocationNormalizedLoaded } from 'vue-router' |
|||
import { useIcon } from '@/hooks/web/useIcon' |
|||
import { setTenantId, setToken } from '@/utils/auth' |
|||
import { usePermissionStore } from '@/store/modules/permission' |
|||
import { getTenantIdByName, sendSmsCode, smsLogin } from '@/api/login' |
|||
import * as UserApi from '@/api/system/user' |
|||
|
|||
const { t } = useI18n() |
|||
const message = useMessage() |
|||
const permissionStore = usePermissionStore() |
|||
const formSmsLogin = ref() |
|||
const loginLoading = ref(false) |
|||
const iconHouse = useIcon({ icon: 'ep:house' }) |
|||
const iconCellphone = useIcon({ icon: 'ep:cellphone' }) |
|||
const iconCircleCheck = useIcon({ icon: 'ep:circle-check' }) |
|||
const rules = { |
|||
username: [required], |
|||
email: [required] |
|||
} |
|||
const loginData = reactive({ |
|||
username: '', |
|||
email: '', |
|||
|
|||
}) |
|||
const loading = ref(false); |
|||
const submitForm = async () => { |
|||
try { |
|||
const data = loginData as unknown as UserApi.UserVO |
|||
await UserApi.forgetPassword(data) |
|||
message.success(t('common.updateSuccess')) |
|||
// 发送操作成功的事件 |
|||
router.go(-1) |
|||
} finally { |
|||
// formLoading.value = false |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
:deep(.anticon) { |
|||
&:hover { |
|||
color: var(--el-color-primary) !important; |
|||
} |
|||
} |
|||
|
|||
.smsbtn { |
|||
margin-top: 33px; |
|||
} |
|||
.box{ |
|||
border: 1px solid #dedede; |
|||
width: 500px; |
|||
margin: 100px auto 0px; |
|||
padding: 20px; |
|||
box-shadow: 0px 0px 20px rgba($color: #000000, $alpha: 0.1); |
|||
} |
|||
.title{ |
|||
text-align: center; |
|||
font-size: 20px; |
|||
font-weight: bold; |
|||
padding-bottom: 20px; |
|||
} |
|||
</style> |
@ -0,0 +1,105 @@ |
|||
<template> |
|||
<div v-loading="loading" class="box"> |
|||
<el-form ref="formSmsLogin" :model="loginData" :rules="rules" label-width="130px" label-position="top" size="large"> |
|||
<div class="title" style="font-size:25px" margin-left="0px">重置密码</div> |
|||
<el-row type="flex" justify="center" align="middle"> |
|||
<el-col> |
|||
<el-form-item label="新密码" prop="password" align="center"> |
|||
<el-input v-model="loginData.password" placeholder="请输入新密码" :type="isShowPassword?'text':'password'"/> |
|||
<el-icon style="position: absolute; right: 10px;cursor: pointer;" color="#a5a5a5" size="18" @click="isShowPassword = !isShowPassword"> |
|||
<View v-if="!isShowPassword"/> |
|||
<Hide v-if="isShowPassword"/> |
|||
</el-icon> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col> |
|||
<el-form-item label="确认新密码" prop="againPassword"> |
|||
<el-input v-model="loginData.againPassword" placeholder="请再次新密码" :type="isShowAgainPassword?'text':'password'"/> |
|||
<el-icon style="position: absolute; right: 10px;cursor: pointer;" color="#a5a5a5" size="18" @click="isShowAgainPassword = !isShowAgainPassword"> |
|||
<View v-if="!isShowAgainPassword"/> |
|||
<Hide v-if="isShowAgainPassword"/> |
|||
</el-icon> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<div class="dialog-footer"> |
|||
<el-button type="primary" @click="submitForm" style="width: 100%;height: 40px;line-height: 40px;">确 定</el-button> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
<script lang="ts" setup name="bb"> |
|||
import type { RouteLocationNormalizedLoaded } from 'vue-router' |
|||
import { useIcon } from '@/hooks/web/useIcon' |
|||
import { setTenantId, setToken } from '@/utils/auth' |
|||
import { usePermissionStore } from '@/store/modules/permission' |
|||
import { getTenantIdByName, sendSmsCode, smsLogin } from '@/api/login' |
|||
import * as UserApi from '@/api/system/user' |
|||
import { View,Hide } from '@element-plus/icons-vue' |
|||
const { t } = useI18n() |
|||
const message = useMessage() |
|||
const permissionStore = usePermissionStore() |
|||
const formSmsLogin = ref() |
|||
const loginLoading = ref(false) |
|||
const iconHouse = useIcon({ icon: 'ep:house' }) |
|||
const iconCellphone = useIcon({ icon: 'ep:cellphone' }) |
|||
const iconCircleCheck = useIcon({ icon: 'ep:circle-check' }) |
|||
const route = useRoute() //路由信息 |
|||
const rules = { |
|||
password: [required], |
|||
againPassword: [required] |
|||
} |
|||
const loginData = reactive({ |
|||
password: '', |
|||
againPassword: '', |
|||
mailKey: '', |
|||
}) |
|||
const isShowPassword = ref(false) |
|||
const isShowAgainPassword = ref(false) |
|||
|
|||
const loading = ref(false); |
|||
const submitForm = async () => { |
|||
try { |
|||
loginData.mailKey = route.query.mailKey; |
|||
if (loginData.password != loginData.againPassword) { |
|||
message.error('两次输入的密码不一致,请重新输入!') |
|||
} else { |
|||
const data = loginData as unknown as UserApi.UserVO |
|||
await UserApi.updatePassword(data) |
|||
// 发送操作成功的事件 |
|||
message.success(t('common.updateSuccess')) |
|||
router.go(-1) |
|||
} |
|||
} finally { |
|||
// formLoading.value = false |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
:deep(.anticon) { |
|||
&:hover { |
|||
color: var(--el-color-primary) !important; |
|||
} |
|||
} |
|||
|
|||
.smsbtn { |
|||
margin-top: 33px; |
|||
} |
|||
.box{ |
|||
border: 1px solid #dedede; |
|||
width: 500px; |
|||
margin: 100px auto 0px; |
|||
padding: 20px; |
|||
box-shadow: 0px 0px 20px rgba($color: #000000, $alpha: 0.1); |
|||
} |
|||
.title{ |
|||
text-align: center; |
|||
font-size: 20px; |
|||
font-weight: bold; |
|||
padding-bottom: 20px; |
|||
} |
|||
::v-deep(.el-input--large .el-input__inner){ |
|||
padding-right: 30px; |
|||
} |
|||
</style> |
@ -0,0 +1,969 @@ |
|||
<template> |
|||
<div> |
|||
<el-drawer |
|||
v-model="isShowDrawer" |
|||
title="详情" |
|||
direction="rtl" |
|||
size="80%" |
|||
v-loading="detailLoading" |
|||
> |
|||
<template #header> |
|||
<div class="font-size-18px"> |
|||
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ titleNameRef }}</span> |
|||
</div> |
|||
</template> |
|||
<Tabs ref="tabRef" :tabsList="tabsList" :current="current" @change="change" /> |
|||
<ContentWrap v-if="!isBasic" v-show="tabsList[current].label=='主数据'"> |
|||
<Descriptions |
|||
:data="detailData" |
|||
labelClassName="label-class-name" |
|||
label-align="left" |
|||
direction="vertical" |
|||
:column="8" |
|||
:schema="allSchemas.detailSchema" |
|||
:columns="2" |
|||
width="200px" |
|||
/> |
|||
</ContentWrap> |
|||
<ContentWrap v-else-if="!isBasicMes" v-show="tabsList[current].label=='主数据'"> |
|||
<Descriptions |
|||
:data="detailData" |
|||
labelClassName="label-class-name" |
|||
label-align="left" |
|||
direction="vertical" |
|||
:column="8" |
|||
:schema="allSchemas.detailSchema" |
|||
:columns="2" |
|||
width="200px" |
|||
|
|||
/> |
|||
</ContentWrap> |
|||
<div class="flex"> |
|||
<!-- 详情 --> |
|||
<ContentWrap class="w-[100%]" v-show="tabsList[current].label!=annexAliasLabel&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'&&tabsList[current].label!='主数据'&&!annexTableData.some(item=>item.label==tabsList[current].label)"> <!-- 列表头部 --> |
|||
<TableHead |
|||
v-if="!isBasic" |
|||
:HeadButttondata="HeadButttondata" |
|||
:masterId="masterParmas.masterId" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="detailAllSchemas" |
|||
/> |
|||
<!-- 默认单表展现 --> |
|||
<Descriptions |
|||
v-if="isBasic && !tabsExtend" |
|||
:data="detailData" |
|||
:schema="allSchemas.detailSchema" |
|||
:columns="2" |
|||
/> |
|||
<!-- 单表切换tabs 展现table --> |
|||
<Table |
|||
v-if="isBasic && tabsExtend" |
|||
:columns="detailAllSchemasRef.tableColumns" |
|||
:data="tableObjectRef.tableList" |
|||
:loading="tableObjectRef.loading" |
|||
:pagination="{ total: tableObjectRef.total }" |
|||
v-model:pageSize="tableObjectRef.pageSize" |
|||
v-model:currentPage="tableObjectRef.currentPage" |
|||
v-model:sort="tableObjectRef.sort" |
|||
> |
|||
<!-- <template #action="{ row }"> |
|||
<ButtonBase |
|||
:Butttondata="buttondata" |
|||
@button-base-click="buttonTableClick($event, row)" |
|||
/> |
|||
</template> --> |
|||
</Table> |
|||
<Table |
|||
v-if="!isBasic && fromeWhere != 'countPlan'" |
|||
:columns="detailAllSchemasRef.tableColumns" |
|||
:data="tableObjectRef.tableList" |
|||
:loading="tableObjectRef.loading" |
|||
:pagination="{ total: tableObjectRef.total }" |
|||
v-model:pageSize="tableObjectRef.pageSize" |
|||
v-model:currentPage="tableObjectRef.currentPage" |
|||
v-model:sort="tableObjectRef.sort" |
|||
> |
|||
<template #photos="{ row }"> |
|||
<div v-for="(item,index) in row.photos.split(',')" :key="index" style="color:#409eff ; cursor: pointer;" @click="openImage(item)">{{ item }}</div> </template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase |
|||
:Butttondata="buttondata" |
|||
@button-base-click="buttonTableClick($event, row)" |
|||
/> |
|||
</template> |
|||
</Table> |
|||
<DetailTable |
|||
v-if="!isBasic && fromeWhere == 'countPlan' && isShowDrawer" |
|||
:columns="detailAllSchemasRef.tableColumns" |
|||
:data="tableObjectRef.tableList" |
|||
:allList="allList" |
|||
:countScopeType="countScopeType" |
|||
:key="updateKey" |
|||
> |
|||
<template #action="{ row }"> |
|||
<ButtonBase |
|||
:Butttondata="buttondata" |
|||
@button-base-click="buttonTableClick($event, row)" |
|||
/> |
|||
</template> |
|||
</DetailTable> |
|||
</ContentWrap> |
|||
<!-- other附件组件:如质检明细 --> |
|||
<div v-for="(annexItem ,index) in annexTableData" :key="index" v-show="annexItem.label==tabsList[current].label" class="w-[100%]" :style="{height:annexItem.hasSubDetail?'100%':remarkHeight+'px'}"> |
|||
<ContentWrap class="w-[100%]"> |
|||
<ElScrollbar ref="scrollbar" :style="{height:annexItem.hasSubDetail?'100%':(remarkHeight-40)+'px'}"> |
|||
<Annex v-show="tabsList[current].label==annexItem.label" |
|||
:annexData="annexItem" |
|||
@handleAnnexSuccess="updateAnnexTableHandle" |
|||
@deleteAnnexSuccess="updateAnnexTableHandle" |
|||
:upData="{...remarksData.data,tableName:annexItem.tableName}" |
|||
/> |
|||
</ElScrollbar> |
|||
</ContentWrap> |
|||
<ContentWrap class="w-[100%]" v-if="annexItem.subDetailTableData"> |
|||
<Table |
|||
v-if="!isBasic && fromeWhere != 'countPlan'" |
|||
:align="annexItem.align?annexItem.align:'center'" |
|||
:columns="annexItem.subDetailTableData.tableColumns" |
|||
:data="annexItem.subDetailTableData.tableList" |
|||
:loading="annexItem.subDetailTableData.loading" |
|||
:pagination="{ total: annexItem.subDetailTableData.tableList.length }" |
|||
v-model:pageSize="tableObjectRef.pageSize" |
|||
v-model:currentPage="tableObjectRef.currentPage" |
|||
v-model:sort="tableObjectRef.sort" |
|||
/> |
|||
</ContentWrap> |
|||
|
|||
</div> |
|||
<!-- 附件/备注/变更记录 --> |
|||
<ContentWrap class="w-[100%]" v-show="tabsList[current].label==annexAliasLabel||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'" :style="{height:remarkHeight+'px'}"> |
|||
<!-- 附件组件 --> |
|||
<ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}"> |
|||
<Annex v-show="tabsList[current].label==annexAliasLabel" |
|||
:annexData="annexData" |
|||
@handleAnnexSuccess="handleAnnexSuccess" |
|||
@deleteAnnexSuccess="deleteAnnexSuccess" |
|||
:upData="remarksData.data" |
|||
:key="count" |
|||
/> |
|||
<!-- 备注组件 --> |
|||
<Remarks v-show="tabsList[current].label=='备注'" |
|||
:remarksData="remarksData" |
|||
class="mt-20px" |
|||
@remarksSubmitScuess="remarksSubmitScuess" |
|||
:key="count" |
|||
/> |
|||
<!-- 变更记录组件 --> |
|||
<ChangeRecord v-show="tabsList[current].label=='变更记录'" :changeRecordData="changeRecordData" class="mt-20px" :key="count"/> |
|||
</ElScrollbar> |
|||
</ContentWrap> |
|||
</div> |
|||
</el-drawer> |
|||
<!-- 表格弹窗 --> |
|||
<SearchTable ref="searchTableRef" @search-table-success="searchTableSuccess1" /> |
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="formRef" |
|||
@success="submitForm" |
|||
:rules="detailAllSchemasRules" |
|||
:formAllSchemas="detailAllSchemas" |
|||
:isBusiness="false" |
|||
:apiUpdate="apiUpdate" |
|||
:apiCreate="apiCreate" |
|||
:fromeWhere="fromeWhere" |
|||
:isDetail="true" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:detailData="detailData" |
|||
@submitForm="submitForm" |
|||
@selectChangeDetail="selectChangeDetail" |
|||
:formTypeDetail="formTypeDetail" |
|||
:countPlanAllList="countPlanAllList" |
|||
@onChange="detailBasicFormOnChange" |
|||
@onBlur="onBlur" |
|||
@formFormDateChange="formFormDateChange" |
|||
/> |
|||
</div> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
|
|||
import Annex from '@/components/Annex/src/Annex.vue' |
|||
import Remarks from '@/components/Remarks/src/Remarks.vue' |
|||
import ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue' |
|||
import Tabs from '@/components/Tabs/src/Tabs.vue' |
|||
import * as RemarkApi from '@/api/wms/remark' |
|||
import * as FileApi from '@/api/wms/file' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import BasicForm from '@/components/BasicForm/src/BasicForm.vue' |
|||
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|||
import DetailTable from '@/components/DetailTable/src/DetailTable.vue' |
|||
import { SearchTable } from '@/components/SearchTable' |
|||
|
|||
defineOptions({ name: 'Detail' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail' |
|||
const updateKey = ref(0) |
|||
|
|||
const props = defineProps({ |
|||
// 标签参数 |
|||
tabs: { |
|||
type: Object, |
|||
required: true, |
|||
default: null |
|||
}, |
|||
//展示附件组件的tab标签 |
|||
annexTable: { |
|||
type: Array, |
|||
required: false, |
|||
default: ()=>[] |
|||
}, |
|||
//展示附件组件的tab标签 |
|||
annexAliasLabel: { |
|||
type: String, |
|||
required: false, |
|||
default: '附件' |
|||
}, |
|||
// 是否是基础数据 展现详情顶部表单 |
|||
isBasic: { |
|||
type: Boolean, |
|||
required: false, |
|||
default: false |
|||
}, |
|||
// 是否是基础数据 mes |
|||
isBasicMes: { |
|||
type: Boolean, |
|||
required: false, |
|||
default: false |
|||
}, |
|||
// 表单,列表 相关信息 |
|||
allSchemas: { |
|||
type: Object, |
|||
required: true, |
|||
default: null |
|||
}, |
|||
// 明细列表相关信息 |
|||
detailAllSchemas: { |
|||
type: Object, |
|||
required: true, |
|||
default: null |
|||
}, |
|||
// 明细验证 |
|||
detailAllSchemasRules: { |
|||
type: Object, |
|||
required: true, |
|||
default: null |
|||
}, |
|||
// 子表新增API |
|||
apiCreate: { |
|||
type: Function, |
|||
required: false, |
|||
default: null |
|||
}, |
|||
// 子表编辑API |
|||
apiUpdate: { |
|||
type: Function, |
|||
required: false, |
|||
default: null |
|||
}, |
|||
// 子表分页列表API |
|||
apiPage: { |
|||
type: Function, |
|||
required: false, |
|||
default: null |
|||
}, |
|||
// 子表删除API |
|||
apiDelete: { |
|||
type: Function, |
|||
required: false, |
|||
default: null |
|||
}, |
|||
// 子表新增修改校验 |
|||
detailValidate: { |
|||
type: Function, |
|||
required: false, |
|||
default: null |
|||
}, |
|||
// 来源 countPlan盘点计划进入 |
|||
fromeWhere: { |
|||
type: String, |
|||
required: false, |
|||
default: '' |
|||
}, |
|||
// 获取接口列表集合 |
|||
allList: { |
|||
type: Object, |
|||
required: true, |
|||
default: null |
|||
}, |
|||
// 盘点范围类型 |
|||
countScopeType: { |
|||
type: Array, |
|||
required: false, |
|||
default: null |
|||
}, |
|||
//盘点详情子表新增的时候判断盘点范围值显示输入框还是下拉框 |
|||
formTypeDetail: { |
|||
type: String, |
|||
required: false, |
|||
default: 'InputString' |
|||
}, |
|||
//盘点详情子表新增的时候判断盘点范围值的下拉列表 |
|||
countPlanAllList: { |
|||
type: Array, |
|||
required: false, |
|||
default: null |
|||
}, |
|||
// 详情列表扩展操作按钮 |
|||
buttondataTable: { |
|||
type: Array, |
|||
required: false, |
|||
default: ()=>{ |
|||
return [] |
|||
} |
|||
}, |
|||
// 针对基础数据tabs扩展 显示table列表 默认false |
|||
tabsExtend: { |
|||
type: Boolean, |
|||
required: false, |
|||
default: false |
|||
}, |
|||
// tableObject 数据过滤条件 针对 详情扩展标签页 传入不同条件 |
|||
tableObjectExtend: { |
|||
type: Array, |
|||
required: false, |
|||
default: null |
|||
}, |
|||
// 子列表 筛选 展示与隐藏 ,默认展示 |
|||
detailButtonIsShowFilter:{ |
|||
type: Boolean, |
|||
required: false, |
|||
default: true |
|||
}, |
|||
// 子列表 新增 展示与隐藏 ,默认展示 |
|||
detailButtonIsShowAdd:{ |
|||
type: Boolean, |
|||
required: false, |
|||
default: true |
|||
}, |
|||
// 子列表 编辑 展示与隐藏 ,默认展示 |
|||
detailButtonIsShowEdit:{ |
|||
type: Boolean, |
|||
required: false, |
|||
default: true |
|||
}, |
|||
// 子列表 删除 展示与隐藏 ,默认展示 |
|||
detailButtonIsShowDelete:{ |
|||
type: Boolean, |
|||
required: false, |
|||
default: true |
|||
}, |
|||
//是否直接展示搜索表单 |
|||
isOpenSearchTable:{ |
|||
type: Boolean, |
|||
required: false, |
|||
default: false |
|||
}, |
|||
//扩展其他按钮 |
|||
otherHeadButttonData:{ |
|||
type:Array, |
|||
required: false, |
|||
default: () => [] |
|||
} |
|||
}) |
|||
const isShowDrawer = ref(false) |
|||
const detailLoading = ref(false) |
|||
const tabsList = ref(JSON.parse(JSON.stringify(props.tabs ? props.tabs : ''))) |
|||
|
|||
// if (props.isBasic == true || props.isBasicMes == true) { |
|||
// if (tabsList.value && tabsList.value.length > 0) { |
|||
// tabsList.value.unshift({ |
|||
// label: '详情', |
|||
// prop: 'Detail' |
|||
// }) |
|||
// } |
|||
// } else { |
|||
// if (tabsList.value && tabsList.value.length > 0) { |
|||
// } else { |
|||
// tabsList.value = [ |
|||
// { |
|||
// label: '明细', |
|||
// prop: 'Detail' |
|||
// } |
|||
// ] |
|||
// } |
|||
// } |
|||
|
|||
const otherList = [...props.annexTable,{ |
|||
label:props.annexAliasLabel, |
|||
prop:'Annex' |
|||
},{ |
|||
label:'备注', |
|||
prop:'Remarks' |
|||
},{ |
|||
label:'变更记录', |
|||
prop:'ChangeRecord' |
|||
}] |
|||
tabsList.value = [...tabsList?.value,...otherList] |
|||
|
|||
if (!tabsList.value || tabsList.value && tabsList.value.length == otherList.length) { |
|||
if (props.isBasic == false && props.isBasicMes == false) { |
|||
tabsList.value.unshift({ |
|||
label: '明细', |
|||
prop: 'Detail' |
|||
})} |
|||
} |
|||
tabsList.value.unshift({ |
|||
label: '主数据', |
|||
prop: 'Descriptions' |
|||
}) |
|||
|
|||
// Tabs |
|||
const tabRef = ref() |
|||
//滚动条 |
|||
const scrollbar = ref() |
|||
//附件 备注 变更记录 高度计算 |
|||
const remarkHeight = computed(() => { |
|||
const tab = unref(tabRef) |
|||
const tabTop = tab?.$el.getBoundingClientRect().top |
|||
const tabHeight = tab?.$el.getBoundingClientRect().height |
|||
console.log('tabTop',tabTop) |
|||
const height = window.innerHeight - (tabTop) - (tabHeight) - 60 |
|||
return height |
|||
}) |
|||
|
|||
|
|||
// 附件默认数据 |
|||
const annexData = reactive({ |
|||
annexList: [] |
|||
}) |
|||
// // 其他附件默认数据数组 |
|||
const annexTableData = ref<Array<any>>([]) |
|||
|
|||
// 备注数据 |
|||
const remarksData = reactive({ |
|||
remarksList: [], |
|||
data: {} |
|||
}) |
|||
|
|||
// 变更记录默认数据 |
|||
const changeRecordData = reactive({ |
|||
changeRecordList: [] |
|||
}) |
|||
const detailData = ref({}) //详情数据 |
|||
// 获取附件列表篇 |
|||
const getFileList = async () => { |
|||
detailLoading.value = true |
|||
try { |
|||
annexData.annexList = await FileApi.getFileList(remarksData.data) |
|||
} finally { |
|||
detailLoading.value = false |
|||
} |
|||
} |
|||
// 获取其他附件列表篇 |
|||
const getAnnexFileList = async (row:id) => { |
|||
console.log('getAnnexFileList') |
|||
props.annexTable?.forEach(async (item) => { |
|||
let requstData = {...remarksData.data,tableName: item?.tableName} |
|||
const annexList = await FileApi.getFileList(requstData) |
|||
const annexData = annexTableData.value.find(annex=>annex.label === item.label) |
|||
if(annexData){ |
|||
annexData.annexList = annexList |
|||
}else{ |
|||
annexTableData.value.push({ |
|||
align:item.align, |
|||
label: item.label, |
|||
tableName: item?.tableName || '', |
|||
annexList, |
|||
hasSubDetail:item.hasSubDetail||false, |
|||
subDetailTableData:item.subDetailTableData |
|||
}) |
|||
if(item?.subDetailTableData){ |
|||
const { tableObject:subTableObject, tableMethods:subTableMethods } = useTable({ |
|||
getListApi: item.subDetailTableData.getSubList // 分页接口 |
|||
}) |
|||
const {getList:getSubList} = subTableMethods |
|||
subTableObject.params= {} |
|||
item.subDetailTableData.queryParams.forEach(queryItem => { |
|||
subTableObject.params[queryItem.queryField] = row[queryItem.rowField] |
|||
}); |
|||
await getSubList() |
|||
item.subDetailTableData.tableList = subTableObject.tableList |
|||
console.log('subTableObject',annexTableData.value) |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
/** 添加附件 */ |
|||
const handleAnnexSuccess = () => { |
|||
getFileList() |
|||
getChangeRecordList() |
|||
} |
|||
// 删除附件成功之后所走的方法 |
|||
const deleteAnnexSuccess = async () => { |
|||
getFileList() |
|||
getChangeRecordList() |
|||
} |
|||
/** 追加的附件 */ |
|||
const updateAnnexTableHandle = () => { |
|||
getAnnexFileList(detailData.value) |
|||
getChangeRecordList() |
|||
} |
|||
|
|||
// Tabs当前选择 |
|||
const current = ref(0) |
|||
const change = (item, index) => { |
|||
current.value = index |
|||
emit('changeTabs', item) |
|||
if(otherList.find(other=>other.label==item.label)){ |
|||
// 附件/备注/变更记录 -- 点击回到顶部 |
|||
scrollbar.value.scrollTo({ top: 0}); |
|||
} |
|||
|
|||
} |
|||
|
|||
//主表所需的参数 |
|||
const masterParmas = ref({ |
|||
masterId: '', //主表id |
|||
number: '', //主表单据号 |
|||
status: '' //主表状态 用于控制子表新增编辑按钮显示情况 |
|||
}) |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = ref() |
|||
// 列表-操作按钮 |
|||
const buttondata = ref() |
|||
|
|||
/** 表格弹窗 */ |
|||
const initModel = (schema: FormSchema[], formModel: Recordable) => { |
|||
const model: Recordable = { ...formModel } |
|||
schema.map((v) => { |
|||
// 如果是hidden,就删除对应的值 |
|||
if (v.hidden) { |
|||
delete model[v.field] |
|||
} else if (v.component && v.component !== 'Divider') { |
|||
const hasField = Reflect.has(model, v.field) |
|||
// 如果先前已经有值存在,则不进行重新赋值,而是采用现有的值 |
|||
model[v.field] = hasField ? model[v.field] : v.value !== void 0 ? v.value : '' |
|||
} |
|||
}) |
|||
return model |
|||
} |
|||
const searchTableRef = ref() |
|||
// 如果需要直接打开表格数据表单数据 |
|||
const searchTableFormModel = ref<Recordable>({}) |
|||
if(props.isOpenSearchTable){ |
|||
searchTableFormModel.value = initModel(props.detailAllSchemas.formSchema, unref(searchTableFormModel)) |
|||
} |
|||
const searchTableFormType = ref('') // 表单的类型:create - 新增;update - 修改 |
|||
|
|||
/** 打开弹窗 */ |
|||
const formRef = ref() |
|||
const titleNameRef = ref() |
|||
const titleValueRef = ref() |
|||
const count =ref(0) |
|||
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => { |
|||
titleNameRef.value = titleName |
|||
titleValueRef.value = titleValue |
|||
remarksData.data = { |
|||
tableId: row.masterId||row.id, |
|||
tableName: tableName |
|||
} |
|||
count.value++ |
|||
// 加载明细列表 |
|||
if (!props.isBasic) { |
|||
// 设置主表id |
|||
masterParmas.value.masterId = row.masterId||row.id |
|||
masterParmas.value.number = row.number |
|||
masterParmas.value.status = row.status |
|||
tableObjectRef.value.params = { |
|||
masterId: row.masterId||row.id |
|||
} |
|||
await getList() |
|||
} |
|||
isShowDrawer.value = true |
|||
if (row) { |
|||
detailLoading.value = true |
|||
try { |
|||
detailData.value = row |
|||
getRemarkList() |
|||
getFileList() |
|||
getAnnexFileList(row) |
|||
getChangeRecordList() |
|||
// 判断详情按钮是否显示 |
|||
let detailButtonFilter: any = [] |
|||
let detailButtonAdd: any = [] |
|||
if (props.detailButtonIsShowFilter) { |
|||
// 筛选 |
|||
detailButtonFilter = [ |
|||
defaultButtons.defaultFilterBtn(null) |
|||
] |
|||
} |
|||
if (props.detailButtonIsShowAdd) { |
|||
// 新增 |
|||
detailButtonAdd = [ |
|||
defaultButtons.defaultAddBtn({ |
|||
hide: isShowMainButton(row, ['1']) |
|||
}) |
|||
] |
|||
} |
|||
HeadButttondata.value = [...detailButtonFilter,...detailButtonAdd] |
|||
|
|||
// 针对特殊处理 当业务是任务的 只显示筛选 正常情况下应在业务页面设置 后期再作优化 |
|||
if (routeName.value.indexOf('Job') > -1) { |
|||
HeadButttondata.value = [ |
|||
defaultButtons.defaultFilterBtn(null) // 筛选 |
|||
] |
|||
} |
|||
HeadButttondata.value = [...HeadButttondata.value,...props.otherHeadButttonData] |
|||
let detailButtonEdit: any = [] |
|||
let detailButtonDelete: any = [] |
|||
if (props.detailButtonIsShowEdit) { |
|||
// 编辑 |
|||
detailButtonEdit = [ |
|||
defaultButtons.mainListEditBtn({ |
|||
hide: isShowMainButton(row, ['1']) |
|||
}) |
|||
] |
|||
} |
|||
if (props.detailButtonIsShowDelete) { |
|||
// 删除 |
|||
detailButtonDelete = [ |
|||
defaultButtons.mainListDeleteBtn({ |
|||
hide: isShowMainButton(row, ['1']) |
|||
}) |
|||
] |
|||
} |
|||
buttondata.value = [...detailButtonEdit,...detailButtonDelete,...props.buttondataTable] |
|||
|
|||
} finally { |
|||
detailLoading.value = false |
|||
} |
|||
} |
|||
} |
|||
defineExpose({ openDetail, formRef }) // 提供 open 方法,用于打开弹窗 |
|||
|
|||
// 获取备注列表 |
|||
const getRemarkList = async () => { |
|||
detailLoading.value = true |
|||
try { |
|||
remarksData.remarksList = await RemarkApi.getRemarkPage(remarksData.data) |
|||
} finally { |
|||
detailLoading.value = false |
|||
} |
|||
} |
|||
// 备注提交成功之后 |
|||
const remarksSubmitScuess = async (remark) => { |
|||
detailLoading.value = false |
|||
getRemarkList() |
|||
getChangeRecordList() |
|||
} |
|||
// 获取变更记录 |
|||
const getChangeRecordList = async () => { |
|||
changeRecordData.changeRecordList = await RemarkApi.getChangeRecordPage(remarksData.data) |
|||
} |
|||
|
|||
const tableObjectRef = ref() |
|||
const tableMethodsRef = ref() |
|||
const detailAllSchemasRef = ref() |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: props.apiPage // 分页接口 |
|||
}) |
|||
|
|||
tableObjectRef.value = tableObject |
|||
tableMethodsRef.value = tableMethods |
|||
detailAllSchemasRef.value = props.detailAllSchemas |
|||
|
|||
// 根据状态返回该按钮是否显示 |
|||
const isShowMainButton = (row, val) => { |
|||
if (val.indexOf(row.status) > -1) { |
|||
return false |
|||
} else { |
|||
return true |
|||
} |
|||
} |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList } = tableMethodsRef.value |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { |
|||
// 新增 |
|||
if(props.isOpenSearchTable){ |
|||
searchTableFormType.value = 'create' |
|||
// 如果需要直接打开表格数据 |
|||
searchTableFormModel.value = Object.assign(unref(searchTableFormModel), { |
|||
masterId: masterParmas.value.masterId, |
|||
number: masterParmas.value.number |
|||
}) |
|||
const item = props.detailAllSchemas.formSchema[0] |
|||
opensearchTable( |
|||
item.field, item?.componentProps?.searchField, |
|||
item?.componentProps?.searchTitle, |
|||
item?.componentProps?.searchAllSchemas, |
|||
item?.componentProps?.searchPage, |
|||
item?.componentProps?.searchCondition, |
|||
item?.componentProps?.multiple, |
|||
undefined,undefined |
|||
) |
|||
}else{ |
|||
openForm('create') |
|||
} |
|||
} else if (val == 'import') { |
|||
// 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { |
|||
// 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { |
|||
// 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { |
|||
// 筛选 |
|||
} else { |
|||
// 其他按钮 |
|||
console.log('其他按钮', item) |
|||
emit('buttonBaseClick',val, item) |
|||
} |
|||
} |
|||
|
|||
// 直接打开表格数据 --> 对应:isOpenSearchTable === true |
|||
const opensearchTable = ( |
|||
formField, |
|||
searchField, |
|||
searchTitle, |
|||
searchAllSchemas, |
|||
searchPage, |
|||
searchCondition, |
|||
multiple, |
|||
type, |
|||
row |
|||
) => { |
|||
const _searchCondition = {} |
|||
// 判断查询条件中,是否存在指向主表的数据 |
|||
if (searchCondition && searchCondition.length > 0) { |
|||
// 转换筛选条件所需 |
|||
for (var i=0; i< searchCondition.length; i++ ) { |
|||
// 查询条件为主表某字段,需要赋值主表数据,数据来源是详情的,赋值需要从row中获取 |
|||
if (searchCondition[i].isMainValue) { |
|||
_searchCondition[searchCondition[i].key] = detailData |
|||
? detailData.value[searchCondition[i].value] |
|||
: '' |
|||
}else{ |
|||
_searchCondition[searchCondition[i].key] = searchCondition[i].value |
|||
} |
|||
} |
|||
} |
|||
console.log(searchCondition) |
|||
console.log(_searchCondition) |
|||
searchTableRef.value.open( |
|||
searchTitle, |
|||
searchAllSchemas, |
|||
searchPage, |
|||
formField, |
|||
searchField, |
|||
multiple, |
|||
type, |
|||
row, |
|||
_searchCondition |
|||
) |
|||
} |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
// const updataTableColumns = (val) => { |
|||
// detailAllSchemas.tableColumns.value = val |
|||
// } |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { |
|||
// 编辑 |
|||
if(props.isOpenSearchTable){ |
|||
searchTableFormType.value = 'update' |
|||
if (row?.id || row?.masterId) { |
|||
searchTableFormModel.value = Object.assign(unref(searchTableFormModel), row) |
|||
} |
|||
const item = props.detailAllSchemas.formSchema[0] |
|||
opensearchTable( |
|||
item.field, item?.componentProps?.searchField, |
|||
item?.componentProps?.searchTitle, |
|||
item?.componentProps?.searchAllSchemas, |
|||
item?.componentProps?.searchPage, |
|||
item?.componentProps?.searchCondition, |
|||
item?.componentProps?.multiple, |
|||
undefined,undefined |
|||
) |
|||
}else{ |
|||
openForm('update', row) |
|||
} |
|||
} else if (val == 'delete') { |
|||
// 删除 |
|||
handleDelete(row.id) |
|||
} else { |
|||
emit('tableFormButton',val, row) |
|||
} |
|||
} |
|||
/** 添加/修改操作 */ |
|||
const openForm = async (type: string, row?: number) => { |
|||
formRef.value.open(type, row, masterParmas.value) |
|||
emit('detailOpenForm', type, row) |
|||
} |
|||
// form 提交 |
|||
const submitForm = async (formType, data) => { |
|||
try { |
|||
// 子表新增编辑校验 如果业务需要子表提交校验 需在主页详情组件添加 detailValidate 参数及方法 |
|||
const rs = (await props.detailValidate) ? await props.detailValidate(data) : true |
|||
if (!rs) return |
|||
if (formType === 'create') { |
|||
await props.apiCreate(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await props.apiUpdate(data) |
|||
message.success(t('common.updateSuccess')) |
|||
} |
|||
emit('handleMainFefresh') |
|||
formRef.value.dialogVisible = false |
|||
// 刷新当前列表 |
|||
await getList() |
|||
updateKey.value += 1 |
|||
} finally { |
|||
formRef.value.formLoading = false |
|||
} |
|||
} |
|||
|
|||
|
|||
const searchTableSuccess1 = (formField, searchField, val, formRef) => { |
|||
searchTableFormModel.value[formField] = val.map(item=>item[searchField]).join(',') |
|||
console.log('searchTableSuccess1',searchTableFormModel) |
|||
submitForm(searchTableFormType.value,searchTableFormModel.value) |
|||
emit('searchTableSuccessDetail', formField, searchField, val, formRef) |
|||
} |
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
emit('searchTableSuccessDetail', formField, searchField, val, formRef) |
|||
} |
|||
// 传递给父类 |
|||
const emit = defineEmits([ |
|||
'searchTableSuccessDetail', |
|||
'changeTabs', |
|||
'selectChangeDetail', |
|||
'detailOpenForm', |
|||
'tableFormButton', |
|||
'openImage', |
|||
'onBlur', |
|||
'detailBasicFormOnChange', |
|||
'formFormDateChange', |
|||
'buttonBaseClick' |
|||
]) |
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
tableObject.loading = true |
|||
// 发起删除 |
|||
await props.apiDelete(id) |
|||
tableObject.loading = false |
|||
message.success(t('common.delSuccess')) |
|||
emit('handleMainFefresh') |
|||
// 刷新列表 |
|||
await getList() |
|||
updateKey.value += 1 |
|||
} catch {} |
|||
} |
|||
// 筛选提交 |
|||
const searchFormClick = async (searchData) => { |
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: props.apiPage // 分页接口 |
|||
}) |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
? searchData.filters |
|||
: [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }] |
|||
} |
|||
detailAllSchemasRef.value = props.detailAllSchemas |
|||
tableObjectRef.value = tableObject |
|||
tableMethodsRef.value = tableMethods |
|||
tableObjectRef.value.tableList = [] |
|||
const { getList } = tableMethods |
|||
await getList() |
|||
updateKey.value += 1 |
|||
// tableObjectRef.value.params = { |
|||
// isSearch: true, |
|||
// filters: searchData.filters |
|||
// ? searchData.filters |
|||
// : [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }] |
|||
// } |
|||
// getList() // 刷新当前列表 |
|||
} |
|||
// 选择盘点类型的时候针对限值的操作 |
|||
const selectChangeDetail = (field, val) => { |
|||
emit('selectChangeDetail', field, val) |
|||
} |
|||
// 打开图片 |
|||
const openImage=(item)=>{ |
|||
emit('openImage', item) |
|||
} |
|||
/** |
|||
* 监听改变事件 |
|||
* @param field 当前操作字段 |
|||
* @param cur 改变后值 |
|||
*/ |
|||
const detailBasicFormOnChange = (field, cur) => { |
|||
emit('detailBasicFormOnChange', field, cur) |
|||
} |
|||
|
|||
/** |
|||
* 监听失焦事件 |
|||
* @param field 当前操作字段 |
|||
* @param e |
|||
*/ |
|||
const onBlur = (field, e) => { |
|||
emit('onBlur', field, e) |
|||
} |
|||
|
|||
// 日期改变事件 |
|||
const formFormDateChange = (field, val,row, index) => { |
|||
emit('formFormDateChange', field, val,row, index) |
|||
} |
|||
//监视属性 |
|||
watch( |
|||
() => props.apiPage, |
|||
() => { |
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: props.apiPage // 分页接口 |
|||
}) |
|||
tableObject.params.masterId = masterParmas.value.masterId |
|||
detailAllSchemasRef.value = props.detailAllSchemas |
|||
if (props.tableObjectExtend) { |
|||
props.tableObjectExtend.forEach(item => { |
|||
tableObject.params[item.key] = item.value |
|||
}) |
|||
} |
|||
tableObjectRef.value = tableObject |
|||
tableMethodsRef.value = tableMethods |
|||
const { getList } = tableMethods |
|||
getList() |
|||
} |
|||
) |
|||
</script> |
|||
<style lang="scss"> |
|||
.el-drawer__body { |
|||
background: #f5f5f5 !important; |
|||
} |
|||
|
|||
::v-deep(.label-class-name) { |
|||
color: #dedede; |
|||
} |
|||
</style> |
|||
<style scoped lang="scss"></style> |
@ -0,0 +1,109 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const HolidayRules = reactive({ |
|||
}) |
|||
|
|||
export const Holiday = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '主键', |
|||
field: 'id', |
|||
sort: 'custom', |
|||
isForm: false, |
|||
}, |
|||
|
|||
|
|||
{ |
|||
label: 'KEY', |
|||
field: 'keyDate', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable:false, |
|||
isForm:false |
|||
}, |
|||
{ |
|||
label: '节日名称', |
|||
field: 'holidayName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '节日类型;', |
|||
field: 'holidayType', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
dictType: DICT_TYPE.HOLIDAY_TYPE, |
|||
dictClass: 'string', |
|||
form: { |
|||
component: 'Select', |
|||
value: '1', |
|||
}, |
|||
}, |
|||
{ |
|||
label: '节日年份', |
|||
field: 'holidayYear', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm:false, |
|||
isTable:true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: '2023', |
|||
}, |
|||
}, |
|||
{ |
|||
label: '节日日期', |
|||
field: 'holidayDate', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'date', |
|||
valueFormat: 'YYYY-MM-DD', |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'date', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '状态', |
|||
field: 'status', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.QUALIFY_STATUS, |
|||
dictClass: 'string', |
|||
isForm: true, |
|||
isSearch: false, |
|||
isTable: true, |
|||
form: { |
|||
component: 'Switch', |
|||
value: '1', |
|||
componentProps: { |
|||
inactiveValue: '2', |
|||
activeValue: '1' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,226 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="Holiday.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="Holiday.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #holidayName="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, row.holidayName, row.holidayName)"> |
|||
<span>{{ row.holidayName }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="formsSuccess" |
|||
:rules="HolidayRules" |
|||
:formAllSchemas="Holiday.allSchemas" |
|||
:apiUpdate="HolidayApi.updateHoliday" |
|||
:apiCreate="HolidayApi.createHoliday" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="false" :is-basic-mes="true" :allSchemas="Holiday.allSchemas" :api-page="HolidayApi.getHolidayPage" :detailAllSchemas="Holiday.allSchemas"/> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/mes/holiday/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { Holiday,HolidayRules } from './holiday.data' |
|||
import * as HolidayApi from '@/api/mes/holiday' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
// import TableHead from '@/components/TableHead/src/TableHead.vue' |
|||
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|||
import Detail from '../../mes/components/Detail.vue' |
|||
|
|||
defineOptions({ name: 'Holiday' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(Holiday.allSchemas.tableColumns) |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: HolidayApi.getHolidayPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'mes:holiday:create'}), // 新增 |
|||
defaultButtons.defaultImportBtn({hasPermi:'mes:holiday:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'mes:holiday:export'}), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
|
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn({hasPermi:'mes:holiday:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'mes:holiday:delete'}), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// form表单提交 |
|||
const formsSuccess = async (formType,data) => { |
|||
if (formType === 'create') { |
|||
await HolidayApi.createHoliday(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await HolidayApi.updateHoliday(data) |
|||
message.success(t('common.updateSuccess')) |
|||
} |
|||
basicFormRef.value.dialogVisible = false |
|||
getList() |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicHoliday') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await HolidayApi.deleteHoliday(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await HolidayApi.exportHoliday(tableObject.params) |
|||
download.excel(data, '节假日设置.xlsx') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '节假日设置导入模版.xlsx' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await HolidayApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue