99 changed files with 4937 additions and 1177 deletions
@ -0,0 +1,66 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface PatternVO { |
|||
deleteTime: Date |
|||
id: number |
|||
status: string |
|||
concurrencyStamp: number |
|||
remark: string |
|||
deleter: string |
|||
siteId: number |
|||
code: string |
|||
name: string |
|||
partternName: string |
|||
productCode: string |
|||
dateUseStart: Date |
|||
dateUseStop: Date |
|||
partternFrom: string |
|||
partternGo: string |
|||
initCout: number |
|||
effectStart: Date |
|||
effectEnd: Date |
|||
factoryCode: string |
|||
factoryName: string |
|||
factoryType: string |
|||
} |
|||
|
|||
// 查询模具基本信息列表
|
|||
export const getPatternPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/mes/pattern/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/mes/pattern/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询模具基本信息详情
|
|||
export const getPattern = async (id: number) => { |
|||
return await request.get({ url: `/mes/pattern/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增模具基本信息
|
|||
export const createPattern = async (data: PatternVO) => { |
|||
return await request.post({ url: `/mes/pattern/create`, data }) |
|||
} |
|||
|
|||
// 修改模具基本信息
|
|||
export const updatePattern = async (data: PatternVO) => { |
|||
return await request.put({ url: `/mes/pattern/update`, data }) |
|||
} |
|||
|
|||
// 删除模具基本信息
|
|||
export const deletePattern = async (id: number) => { |
|||
return await request.delete({ url: `/mes/pattern/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出模具基本信息 Excel
|
|||
export const exportPattern = async (params) => { |
|||
return await request.download({ url: `/mes/pattern/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/mes/pattern/get-import-template' }) |
|||
} |
@ -0,0 +1,54 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface PatternTypeVO { |
|||
deleteTime: Date |
|||
id: number |
|||
status: string |
|||
concurrencyStamp: number |
|||
remark: string |
|||
deleter: string |
|||
siteId: number |
|||
code: string |
|||
name: string |
|||
} |
|||
|
|||
// 查询模具类型列表
|
|||
export const getPatternTypePage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/mes/pattern-type/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/mes/pattern-type/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询模具类型详情
|
|||
export const getPatternType = async (id: number) => { |
|||
return await request.get({ url: `/mes/pattern-type/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增模具类型
|
|||
export const createPatternType = async (data: PatternTypeVO) => { |
|||
return await request.post({ url: `/mes/pattern-type/create`, data }) |
|||
} |
|||
|
|||
// 修改模具类型
|
|||
export const updatePatternType = async (data: PatternTypeVO) => { |
|||
return await request.put({ url: `/mes/pattern-type/update`, data }) |
|||
} |
|||
|
|||
// 删除模具类型
|
|||
export const deletePatternType = async (id: number) => { |
|||
return await request.delete({ url: `/mes/pattern-type/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出模具类型 Excel
|
|||
export const exportPatternType = async (params) => { |
|||
return await request.download({ url: `/mes/pattern-type/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/mes/pattern-type/get-import-template' }) |
|||
} |
@ -0,0 +1,65 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface InspectionRecordDetailVO { |
|||
number: string |
|||
applicationDate: localdate |
|||
applicationTime: Date |
|||
requestStartTime: Date |
|||
requestEndTime: Date |
|||
finishTime: Date |
|||
supplierCode: string |
|||
materialCode: string |
|||
batch: string |
|||
requestInspectionNum: number |
|||
referenceOrderCode: string |
|||
referenceOrderRow: number |
|||
referenceCertificateCode: string |
|||
referenceCertificateRow: number |
|||
inspectionSchemeCode: string |
|||
inspectionStageCode: string |
|||
applicationPackageCode: string |
|||
inspectionLevel: string |
|||
aqlValue: number |
|||
available: string |
|||
} |
|||
|
|||
// 查询检验申请列表
|
|||
export const getInspectionRecordDetailPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/inspection/inspection-recordord-detail/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/inspection/inspectirecordrecord-detail/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询检验申请详情
|
|||
export const getInspectionRecordDetail = async (id: number) => { |
|||
return await request.get({ url: `/inspection/insperecordon-record-detail/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增检验申请
|
|||
export const createInspectionRecordDetail = async (data: InspectionRecordDetailVO) => { |
|||
return await request.post({ url: `/inspection/inrecordction-record-detail/create`, data }) |
|||
} |
|||
|
|||
// 修改检验申请
|
|||
export const updateInspectionRecordDetail = async (data: InspectionRecordDetailVO) => { |
|||
return await request.put({ url: `/inspectionrecordspection-record-detail/update`, data }) |
|||
} |
|||
|
|||
// 删除检验申请
|
|||
export const deleteInspectionRecordDetail = async (id: number) => { |
|||
return await request.delete({ url: `/inspectrecord/inspection-record-detail/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出检验申请 Excel
|
|||
export const exportInspectionRecordDetail = async (params) => { |
|||
return await request.download({ url: `/insprecordion/inspection-record-detail/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/irecordection/inspection-record-detail/get-import-template' }) |
|||
} |
@ -0,0 +1,65 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface InspectionRecordMainVO { |
|||
number: string |
|||
applicationDate: localdate |
|||
applicationTime: Date |
|||
requestStartTime: Date |
|||
requestEndTime: Date |
|||
finishTime: Date |
|||
supplierCode: string |
|||
materialCode: string |
|||
batch: string |
|||
requestInspectionNum: number |
|||
referenceOrderCode: string |
|||
referenceOrderRow: number |
|||
referenceCertificateCode: string |
|||
referenceCertificateRow: number |
|||
inspectionSchemeCode: string |
|||
inspectionStageCode: string |
|||
applicationPackageCode: string |
|||
inspectionLevel: string |
|||
aqlValue: number |
|||
available: string |
|||
} |
|||
|
|||
// 查询检验申请列表
|
|||
export const getInspectionRecordMainPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/inspection/inspection-record-main/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/inspection/inspection-record-main/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询检验申请详情
|
|||
export const getInspectionRecordMain = async (id: number) => { |
|||
return await request.get({ url: `/inspection/inspection-record-main/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增检验申请
|
|||
export const createInspectionRecordMain = async (data: InspectionRecordMainVO) => { |
|||
return await request.post({ url: `/inspection/inspection-record-main/create`, data }) |
|||
} |
|||
|
|||
// 修改检验申请
|
|||
export const updateInspectionRecordMain = async (data: InspectionRecordMainVO) => { |
|||
return await request.put({ url: `/inspection/inspection-record-main/update`, data }) |
|||
} |
|||
|
|||
// 删除检验申请
|
|||
export const deleteInspectionRecordMain = async (id: number) => { |
|||
return await request.delete({ url: `/inspection/inspection-record-main/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出检验申请 Excel
|
|||
export const exportInspectionRecordMain = async (params) => { |
|||
return await request.download({ url: `/inspection/inspection-record-main/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/inspection/inspection-record-main/get-import-template' }) |
|||
} |
@ -0,0 +1,57 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface SystemInstallPackageVO { |
|||
id: number |
|||
installPackageName: string |
|||
installPackageVersion: number |
|||
installPackageUrl: string |
|||
isForcedUpdate: string |
|||
updateContent: string |
|||
remark: string |
|||
} |
|||
|
|||
// 查询安装包信息列表
|
|||
export const getSystemInstallPackagePage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/wms/system-install-package/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/wms/system-install-package/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询安装包信息详情
|
|||
export const getSystemInstallPackage = async (id: number) => { |
|||
return await request.get({ url: `/wms/system-install-package/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增安装包信息
|
|||
export const createSystemInstallPackage = async (data: SystemInstallPackageVO) => { |
|||
return await request.post({ url: `/wms/system-install-package/create`, data }) |
|||
} |
|||
|
|||
// 修改安装包信息
|
|||
export const updateSystemInstallPackage = async (data: SystemInstallPackageVO) => { |
|||
return await request.put({ url: `/wms/system-install-package/update`, data }) |
|||
} |
|||
|
|||
// 删除安装包信息
|
|||
export const deleteSystemInstallPackage = async (id: number) => { |
|||
return await request.delete({ url: `/wms/system-install-package/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出安装包信息 Excel
|
|||
export const exportSystemInstallPackage = async (params) => { |
|||
return await request.download({ url: `/wms/system-install-package/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/wms/system-install-package/get-import-template' }) |
|||
} |
|||
|
|||
// 返回最新版本安装包信息
|
|||
export const returnNewFileSystemInstallPackage = async (data: SystemInstallPackageVO) => { |
|||
return await request.post({ url: `/wms/system-install-package/returnNewFile`, data }) |
|||
} |
@ -0,0 +1,177 @@ |
|||
import type {CrudSchema} from '@/hooks/web/useCrudSchemas' |
|||
import {dateFormatter} from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const MesOrderMonthSubRules = reactive({ |
|||
productCode: [required], |
|||
productName: [required], |
|||
bomCode: [required], |
|||
inStoreCode: [required], |
|||
planBegin: [required], |
|||
planEnd: [required], |
|||
planCount: [required], |
|||
productBatchcode: [required] |
|||
}) |
|||
|
|||
export const MesOrderMonthSub = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '产品编码', |
|||
field: 'productCode', |
|||
sort: 'custom', |
|||
isTable: false, |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '产品名称', |
|||
field: 'productName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false |
|||
}, |
|||
{ |
|||
label: 'BOM编号', |
|||
field: 'bomCode', |
|||
sort: 'custom', |
|||
isTable: false, |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '入库仓库编码', |
|||
field: 'inStoreCode', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '计划数量', |
|||
field: 'planCount', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
} |
|||
}, |
|||
{ |
|||
label: '完成数量', |
|||
field: 'finishCount', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false |
|||
}, |
|||
{ |
|||
label: '合格数量', |
|||
field: 'qualifiedCount', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false |
|||
}, |
|||
{ |
|||
label: '不合格数量', |
|||
field: 'unqualifiedCount', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false |
|||
}, |
|||
{ |
|||
label: '是否回冲', |
|||
field: 'flagBackwash', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false |
|||
}, |
|||
{ |
|||
label: '产品批次号', |
|||
field: 'productBatchcode', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, { |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false |
|||
}, |
|||
{ |
|||
label: '计划开始日期', |
|||
field: 'planBegin', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
style: {width: '100%'}, |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '计划结束日期', |
|||
field: 'planEnd', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
style: {width: '100%'}, |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '实际开工日期', |
|||
field: 'realStart', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false |
|||
}, |
|||
{ |
|||
label: '实际完工日期', |
|||
field: 'realFinish', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
isTable: false |
|||
}, |
|||
{ |
|||
label: '状态', |
|||
field: 'status', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,244 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="Pattern.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="Pattern.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 #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</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="PatternRules" |
|||
:formAllSchemas="Pattern.allSchemas" |
|||
:apiUpdate="PatternApi.updatePattern" |
|||
:apiCreate="PatternApi.createPattern" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="Pattern.allSchemas" /> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/mes/pattern/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { Pattern,PatternRules } from './pattern.data' |
|||
import * as PatternApi from '@/api/mes/pattern' |
|||
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 '@/components/Detail/src/Detail.vue' |
|||
|
|||
defineOptions({ name: 'Pattern' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(Pattern.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: PatternApi.getPatternPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'mes:pattern:create'}), // 新增 |
|||
defaultButtons.defaultImportBtn({hasPermi:'mes:pattern:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'mes:pattern:export'}), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
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:pattern:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'mes:pattern: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) => { |
|||
var isHave =Pattern.allSchemas.formSchema.some(function (item) { |
|||
return item.field === 'activeTime' || item.field === 'expireTime'; |
|||
}); |
|||
if(isHave){ |
|||
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ |
|||
message.error('失效时间要大于生效时间') |
|||
return; |
|||
} |
|||
} |
|||
if(data.activeTime==0)data.activeTime = null; |
|||
if(data.expireTime==0)data.expireTime = null; |
|||
if (formType === 'create') { |
|||
await PatternApi.createPattern(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await PatternApi.updatePattern(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, 'basicPattern') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await PatternApi.deletePattern(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 PatternApi.exportPattern(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 PatternApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,217 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const PatternRules = reactive({ |
|||
concurrencyStamp: [required], |
|||
}) |
|||
|
|||
export const Pattern = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '删除时间', |
|||
field: 'deleteTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '主键', |
|||
field: 'id', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '并发乐观锁', |
|||
field: 'concurrencyStamp', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '删除用户名', |
|||
field: 'deleter', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '位置ID', |
|||
field: 'siteId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '模具编码', |
|||
field: 'code', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '模具名称', |
|||
field: 'name', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '模具类型', |
|||
field: 'partternName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '产品编码', |
|||
field: 'productCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '启用时间', |
|||
field: 'dateUseStart', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '停用时间', |
|||
field: 'dateUseStop', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '模具来源', |
|||
field: 'partternFrom', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '模具去向', |
|||
field: 'partternGo', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '模具初始数量', |
|||
field: 'initCout', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '有效期开始时间', |
|||
field: 'effectStart', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '有效期结束时间', |
|||
field: 'effectEnd', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '所属单位编码', |
|||
field: 'factoryCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '所属单位名称', |
|||
field: 'factoryName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '所属单位类别', |
|||
field: 'factoryType', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '状态', |
|||
field: 'status', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.QUALIFY_STATUS, |
|||
dictClass: 'string', |
|||
isForm: true, |
|||
isSearch: true, |
|||
isTable: true, |
|||
form: { |
|||
component: 'Switch', |
|||
value: '2', |
|||
componentProps: { |
|||
inactiveValue: '2', |
|||
activeValue: '1' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
isDetail:false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false |
|||
} |
|||
])) |
@ -0,0 +1,244 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="PatternType.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="PatternType.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 #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</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="PatternTypeRules" |
|||
:formAllSchemas="PatternType.allSchemas" |
|||
:apiUpdate="PatternTypeApi.updatePatternType" |
|||
:apiCreate="PatternTypeApi.createPatternType" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="PatternType.allSchemas" /> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/mes/pattern-type/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { PatternType,PatternTypeRules } from './patternType.data' |
|||
import * as PatternTypeApi from '@/api/mes/patternType' |
|||
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 '@/components/Detail/src/Detail.vue' |
|||
|
|||
defineOptions({ name: 'PatternType' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(PatternType.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: PatternTypeApi.getPatternTypePage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'mes:patternType:create'}), // 新增 |
|||
defaultButtons.defaultImportBtn({hasPermi:'mes:patternType:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'mes:patternType:export'}), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
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:patternType:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'mes:patternType: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) => { |
|||
var isHave =PatternType.allSchemas.formSchema.some(function (item) { |
|||
return item.field === 'activeTime' || item.field === 'expireTime'; |
|||
}); |
|||
if(isHave){ |
|||
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ |
|||
message.error('失效时间要大于生效时间') |
|||
return; |
|||
} |
|||
} |
|||
if(data.activeTime==0)data.activeTime = null; |
|||
if(data.expireTime==0)data.expireTime = null; |
|||
if (formType === 'create') { |
|||
await PatternTypeApi.createPatternType(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await PatternTypeApi.updatePatternType(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, 'basicPatternType') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await PatternTypeApi.deletePatternType(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 PatternTypeApi.exportPatternType(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 PatternTypeApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,145 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const PatternTypeRules = reactive({ |
|||
code: [required], |
|||
name: [required] |
|||
}) |
|||
|
|||
export const PatternType = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '删除时间', |
|||
field: 'deleteTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '主键', |
|||
field: 'id', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '并发乐观锁', |
|||
field: 'concurrencyStamp', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '删除用户名', |
|||
field: 'deleter', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '位置ID', |
|||
field: 'siteId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm:false, |
|||
isDetail:false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '类型编码', |
|||
field: 'code', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '类型名称', |
|||
field: 'name', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '状态', |
|||
field: 'status', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.QUALIFY_STATUS, |
|||
dictClass: 'string', |
|||
isForm: true, |
|||
isSearch: true, |
|||
isTable: true, |
|||
form: { |
|||
component: 'Switch', |
|||
value: '2', |
|||
componentProps: { |
|||
inactiveValue: '2', |
|||
activeValue: '1' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
isDetail:false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false |
|||
} |
|||
])) |
@ -1,83 +0,0 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const MesOrderMonthMainRules = reactive({ |
|||
}) |
|||
|
|||
export const MesOrderMonthMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
isTable: false |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false |
|||
}, |
|||
{ |
|||
label: '创建者用户名', |
|||
field: 'creator', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false |
|||
}, |
|||
{ |
|||
label: '主计划编码', |
|||
field: 'planMasterCode', |
|||
sort: 'custom', |
|||
isTable: false, |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '计划辅助编码', |
|||
field: 'planSubCode', |
|||
sort: 'custom', |
|||
isTable: false, |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '计划类型', |
|||
field: 'planType', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'SelectV2' |
|||
} |
|||
}, |
|||
{ |
|||
label: '工厂编码', |
|||
field: 'factoryCode', |
|||
sort: 'custom', |
|||
isTable: false |
|||
}, |
|||
{ |
|||
label: '工厂名称', |
|||
field: 'factoryName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
File diff suppressed because it is too large
@ -0,0 +1,289 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="InspectionRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" |
|||
:allSchemas="InspectionRecordMain.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 #number="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|||
<span>{{ row.number }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm ref="formRef" @success="getList" :rules="InspectionRecordMainRules" |
|||
:formAllSchemas="InspectionRecordMain.allSchemas" :tableAllSchemas="InspectionRecordDetail.allSchemas" |
|||
:tableFormRules="InspectionRecordDetailRules" :tableData="tableData" |
|||
:apiUpdate="InspectionRecordMainApi.updateInspectionRecordMain" |
|||
:apiCreate="InspectionRecordMainApi.createInspectionRecordMain" :isBusiness="true" @handleAddTable="handleAddTable" |
|||
@handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" /> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas" |
|||
:detailAllSchemas="InspectionRecordDetail.allSchemas" :detailAllSchemasRules="InspectionRecordDetailRules" |
|||
:apiCreate="InspectionRecordDetailApi.createInspectionRecordDetail" |
|||
:apiUpdate="InspectionRecordDetailApi.updateInspectionRecordDetail" |
|||
:apiPage="InspectionRecordDetailApi.getInspectionRecordDetailPage" |
|||
:apiDelete="InspectionRecordDetailApi.deleteInspectionRecordDetail" |
|||
@searchTableSuccessDetail="searchTableSuccessDetail" :isShowAddBtn="false" :detailButtonIsShow="true" /> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData" |
|||
@success="importSuccess" :isShowOut="true" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { InspectionRecordMain, InspectionRecordMainRules, InspectionRecordDetail, InspectionRecordDetailRules } from './inspectionRecordMain.data' |
|||
import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain' |
|||
import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|||
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|||
|
|||
// 采购订单 |
|||
defineOptions({ name: 'InspectionRecordMain' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(InspectionRecordMain.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|||
nextTick(async () => { |
|||
if (type == 'tableForm') { |
|||
// 明细查询页赋值 |
|||
row[formField] = val[0][searchField] |
|||
// row['itemNumber'] = val[0]['number'] |
|||
// row['itemName'] = val[0]['name'] |
|||
// row['uom'] = val[0]['uom'] |
|||
// row['isRadeIn'] = val[0]['isRadeIn'] |
|||
// row['available'] = val[0]['available'] |
|||
} else { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
} |
|||
}) |
|||
} |
|||
// 查询页面返回——详情 |
|||
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|||
nextTick(async () => { |
|||
const setV = {} |
|||
// if(formField == 'itemCode'){ |
|||
// await ItembasicApi.getItembasicPage({ |
|||
// code: setV['itemCode'] |
|||
// }).then(res => { |
|||
// setV['uom'] = res.list[0].uom |
|||
// setV[formField] = val[0][searchField] |
|||
// }) |
|||
// } |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
// 子表新增的时候选择表格之后需要会显得字段 |
|||
const Echo = [] |
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: InspectionRecordMainApi.getInspectionRecordMainPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn(null), // 新增 |
|||
// defaultButtons.defaultExportBtn(null), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
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 isShowMainButton = (row, val) => { |
|||
if (val.indexOf(row.status) > -1) { |
|||
return false |
|||
} else { |
|||
return true |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = (row) => { |
|||
return [ |
|||
// defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']) }), // 完成 |
|||
// defaultButtons.mainListEditBtn(null), // 编辑 |
|||
// defaultButtons.mainListDeleteBtn(null), // 删除 |
|||
] |
|||
} |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} |
|||
else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const formRef = ref() |
|||
const openForm = async (type : string, row ?: number) => { |
|||
tableData.value = [] // 重置明细数据 |
|||
formRef.value.open(type, row) |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row : any, titleName : any, titleValue : any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicInspectionRecordMain') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id : number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await InspectionRecordMainApi.deleteInspectionRecordMain(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 InspectionRecordMainApi.exportInspectionRecordMain(tableObject.params) |
|||
download.excel(data, '备件申领记录主.xlsx') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* tableForm方法 |
|||
*/ |
|||
const tableFormKeys = {} |
|||
InspectionRecordDetail.allSchemas.tableFormColumns.forEach(item => { |
|||
tableFormKeys[item.field] = item.default ? item.default : '' |
|||
}) |
|||
const tableData = ref([]) |
|||
|
|||
// 添加明细 |
|||
const handleAddTable = () => { |
|||
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
|||
} |
|||
// 删除明细 |
|||
const handleDeleteTable = (item, index) => { |
|||
tableData.value.splice(index, 1) |
|||
} |
|||
|
|||
// 主子数据 提交 |
|||
const submitForm = async (formType, data) => { |
|||
data.subList = tableData.value // 拼接子表数据参数 |
|||
try { |
|||
if (formType === 'create') { |
|||
await InspectionRecordMainApi.createInspectionRecordMain(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await InspectionRecordMainApi.updateInspectionRecordMain(data) |
|||
message.success(t('common.updateSuccess')) |
|||
} |
|||
formRef.value.dialogVisible = false |
|||
// 刷新当前列表 |
|||
getList() |
|||
} finally { |
|||
formRef.value.formLoading = 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 InspectionRecordMainApi.importTemplate() |
|||
}) |
|||
</script> |
@ -0,0 +1,453 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter2 } from '@/utils/formatTime' |
|||
import { validateHanset, validateEmail } from '@/utils/validator' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
const { t } = useI18n() // 国际化
|
|||
|
|||
/** |
|||
* @returns {Array} 备件申请主表 |
|||
*/ |
|||
export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '记录编号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '申请编码', |
|||
field: 'applicationCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '任务编码', |
|||
field: 'taskCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '供应商编码', |
|||
field: 'supplierCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '物料编码', |
|||
field: 'materialCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '批次', |
|||
field: 'batch', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '检验方案编码', |
|||
field: 'inspectionSchemeCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '检验方案Json', |
|||
field: 'inspectionSchemeJson', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '检验批次', |
|||
field: 'inspectionBatch', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '检验批数量', |
|||
field: 'inspectionBatchAmount', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '采样总数量', |
|||
field: 'sampleTatalAmount', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '检验类型', |
|||
field: 'inspectionType', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'Select' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '检验批来源', |
|||
field: 'inspectionBatchSource', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '订单号', |
|||
field: 'orderCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '订单行', |
|||
field: 'orderRow', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '凭证号', |
|||
field: 'certificateCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '凭证行', |
|||
field: 'certificateRow', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '检验阶段', |
|||
field: 'inspectionStage', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '检验严格性', |
|||
field: 'inspectionStringency', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '使用决策', |
|||
field: 'useDecision', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '计划开始时间', |
|||
field: 'planStartTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '计划结束时间', |
|||
field: 'planEndTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '实际开始时间', |
|||
field: 'realStartTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '实际结束时间', |
|||
field: 'realEndTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '检验水平', |
|||
field: 'inspectionLevel', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: 'AQL值', |
|||
field: 'aqlValue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '是否可用', |
|||
field: 'available', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
|
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isDetail: false, |
|||
isForm: false, |
|||
table: { |
|||
width: 200, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
|||
|
|||
//表单校验
|
|||
export const InspectionRecordMainRules = reactive({ |
|||
number: [required], |
|||
applicationCode: [required], |
|||
taskCode: [required], |
|||
supplierCode: [required], |
|||
materialCode: [required], |
|||
batch: [required], |
|||
inspectionSchemeCode: [required], |
|||
inspectionBatch: [required], |
|||
inspectionBatchAmount: [required], |
|||
sampleTatalAmount: [required], |
|||
inspectionType: [required], |
|||
inspectionBatchSource: [required], |
|||
orderCode: [required], |
|||
orderRow: [required], |
|||
inspectionStage: [required], |
|||
inspectionStringency: [required], |
|||
useDecision: [required], |
|||
inspectionLevel: [required], |
|||
available: [required], |
|||
|
|||
}) |
|||
|
|||
/** |
|||
* @returns {Array} 备件申请子表 |
|||
*/ |
|||
export const InspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: 'id', |
|||
field: 'id', |
|||
sort: 'custom', |
|||
isTable: false, |
|||
isSearch: false, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '记录编码', |
|||
field: 'recordCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '工序编码', |
|||
field: 'processCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '工序描述', |
|||
field: 'processDescribe', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '顺序号', |
|||
field: 'sequenceCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '是否破坏性检验', |
|||
field: 'isDestroyInspection', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'Radio' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '检验开始时间', |
|||
field: 'inspectionStartTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '检验结束时间', |
|||
field: 'inspectionEndTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '检验人', |
|||
field: 'inspectionOperator', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '检验特性编码', |
|||
field: 'inspectionFeaturesCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '是否可用', |
|||
field: 'available', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
|
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isDetail: false, |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
}, |
|||
isTableForm: false, |
|||
} |
|||
])) |
|||
|
|||
//表单校验
|
|||
export const InspectionRecordDetailRules = reactive({ |
|||
recordCode: [required], |
|||
processCode: [required], |
|||
sequenceCode: [required], |
|||
isDestroyInspection: [required], |
|||
available: [required], |
|||
}) |
@ -0,0 +1,198 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="SystemInstallPackage.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="SystemInstallPackage.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 #installPackageName="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '安装包名称', row.installPackageName)"> |
|||
<span>{{ row.installPackageName }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
:sumFormDataByForm ="(formRef,formModel)=>{ |
|||
console.log(formModel) |
|||
const {uploadFile} = formModel |
|||
formRef.value.setValues({ |
|||
installPackageUrl:uploadFile |
|||
}) |
|||
}" |
|||
@success="formsSuccess" |
|||
:rules="SystemInstallPackageRules" |
|||
:formAllSchemas="SystemInstallPackage.allSchemas" |
|||
:apiUpdate="SystemInstallPackageApi.updateSystemInstallPackage" |
|||
:apiCreate="SystemInstallPackageApi.createSystemInstallPackage" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="SystemInstallPackage.allSchemas" /> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
// import download from '@/utils/download' |
|||
import { SystemInstallPackage,SystemInstallPackageRules } from './systemInstallPackage.data' |
|||
import * as SystemInstallPackageApi from '@/api/wms/systemInstallPackage' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|||
import Detail from '@/components/Detail/src/Detail.vue' |
|||
|
|||
defineOptions({ name: 'SystemInstallPackage' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(SystemInstallPackage.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: SystemInstallPackageApi.getSystemInstallPackagePage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'wms:system-install-package:importFile'}), // 新增 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
] |
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn({hasPermi:'wms:system-install-package:update'}), // 编辑 |
|||
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:system-install-package: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) => { |
|||
if('create'==type){ |
|||
const currentTime = new Date().getTime() |
|||
const fileId = SystemInstallPackage.allSchemas.formSchema.find(item=>item.field=='fileId') |
|||
fileId['value'] = currentTime |
|||
const uploadFile = SystemInstallPackage.allSchemas.formSchema.find(item=>item.field=='uploadFile') |
|||
uploadFile['componentProps']['upData']['tableId'] = currentTime |
|||
} |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// form表单提交 |
|||
const formsSuccess = async (formType,data) => { |
|||
if (formType === 'create') { |
|||
delete data['uploadFile'] |
|||
await SystemInstallPackageApi.createSystemInstallPackage(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await SystemInstallPackageApi.updateSystemInstallPackage(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, 'basicSystemInstallPackage') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await SystemInstallPackageApi.deleteSystemInstallPackage(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,114 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const SystemInstallPackageRules = reactive({ |
|||
installPackageName: [required], |
|||
installPackageVersion: [required], |
|||
installPackageUrl: [required], |
|||
isForcedUpdate: [required], |
|||
}) |
|||
|
|||
export const SystemInstallPackage = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '安装包名称', |
|||
field: 'installPackageName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '安装包版本', |
|||
field: 'installPackageVersion', |
|||
sort: 'custom', |
|||
}, |
|||
{ |
|||
label: '安装路径', |
|||
field: 'installPackageUrl', |
|||
sort: 'custom', |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
}, |
|||
} |
|||
}, |
|||
{ |
|||
label: '是否强制更新', |
|||
field: 'isForcedUpdate', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
table: { |
|||
width: 140 |
|||
}, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '更新内容', |
|||
field: 'updateContent', |
|||
sort: 'custom', |
|||
}, |
|||
{ |
|||
label: '附件id', |
|||
field: 'fileId', |
|||
sort: 'custom', |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
}, |
|||
value:'', |
|||
} |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
}, |
|||
{ |
|||
label: '上传附件', |
|||
field: 'uploadFile', |
|||
sort: 'custom', |
|||
form: { |
|||
component: 'UploadFile', |
|||
componentProps: { |
|||
upData:{ |
|||
tableId: '', |
|||
tableName: '' |
|||
}, |
|||
limit:1 |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
Loading…
Reference in new issue