ljlong_2630
1 month ago
18 changed files with 1670 additions and 3 deletions
@ -0,0 +1,53 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface ApplicantInfoConfigVO { |
|||
id: number |
|||
applicant: string |
|||
employeeNumber: string |
|||
phone: string |
|||
describes: string |
|||
siteId: string |
|||
available: string |
|||
concurrencyStamp: number |
|||
} |
|||
|
|||
// 查询申请人信息配置列表
|
|||
export const getApplicantInfoConfigPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/basic/applicant-info-config/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/basic/applicant-info-config/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询申请人信息配置详情
|
|||
export const getApplicantInfoConfig = async (id: number) => { |
|||
return await request.get({ url: `/basic/applicant-info-config/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增申请人信息配置
|
|||
export const createApplicantInfoConfig = async (data: ApplicantInfoConfigVO) => { |
|||
return await request.post({ url: `/basic/applicant-info-config/create`, data }) |
|||
} |
|||
|
|||
// 修改申请人信息配置
|
|||
export const updateApplicantInfoConfig = async (data: ApplicantInfoConfigVO) => { |
|||
return await request.put({ url: `/basic/applicant-info-config/update`, data }) |
|||
} |
|||
|
|||
// 删除申请人信息配置
|
|||
export const deleteApplicantInfoConfig = async (id: number) => { |
|||
return await request.delete({ url: `/basic/applicant-info-config/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出申请人信息配置 Excel
|
|||
export const exportApplicantInfoConfig = async (params) => { |
|||
return await request.download({ url: `/basic/applicant-info-config/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/basic/applicant-info-config/get-import-template' }) |
|||
} |
@ -0,0 +1,63 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface InfoPushRecordDetailVO { |
|||
id: number |
|||
masterId: number |
|||
mc: string |
|||
wlh: string |
|||
ggxh: string |
|||
sl: number |
|||
dw: string |
|||
ckdj: number |
|||
zj: number |
|||
kcs: number |
|||
financer: string |
|||
subjectCode: string |
|||
purchaser: string |
|||
costCenter: string |
|||
purpose: string |
|||
siteId: string |
|||
available: string |
|||
concurrencyStamp: number |
|||
} |
|||
|
|||
// 查询物料信息推送记录子列表
|
|||
export const getInfoPushRecordDetailPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/basic/info-push-record-detail/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/basic/info-push-record-detail/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询物料信息推送记录子详情
|
|||
export const getInfoPushRecordDetail = async (id: number) => { |
|||
return await request.get({ url: `/basic/info-push-record-detail/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增物料信息推送记录子
|
|||
export const createInfoPushRecordDetail = async (data: InfoPushRecordDetailVO) => { |
|||
return await request.post({ url: `/basic/info-push-record-detail/create`, data }) |
|||
} |
|||
|
|||
// 修改物料信息推送记录子
|
|||
export const updateInfoPushRecordDetail = async (data: InfoPushRecordDetailVO) => { |
|||
return await request.put({ url: `/basic/info-push-record-detail/update`, data }) |
|||
} |
|||
|
|||
// 删除物料信息推送记录子
|
|||
export const deleteInfoPushRecordDetail = async (id: number) => { |
|||
return await request.delete({ url: `/basic/info-push-record-detail/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出物料信息推送记录子 Excel
|
|||
export const exportInfoPushRecordDetail = async (params) => { |
|||
return await request.download({ url: `/basic/info-push-record-detail/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/basic/info-push-record-detail/get-import-template' }) |
|||
} |
@ -0,0 +1,55 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface InfoPushRecordMainVO { |
|||
id: number |
|||
sqr: string |
|||
shdd: string |
|||
yqdhsj: string |
|||
lxdh: string |
|||
hjje: number |
|||
describes: string |
|||
siteId: string |
|||
available: string |
|||
concurrencyStamp: number |
|||
} |
|||
|
|||
// 查询物料信息推送记录主列表
|
|||
export const getInfoPushRecordMainPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/basic/info-push-record-main/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/basic/info-push-record-main/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询物料信息推送记录主详情
|
|||
export const getInfoPushRecordMain = async (id: number) => { |
|||
return await request.get({ url: `/basic/info-push-record-main/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增物料信息推送记录主
|
|||
export const createInfoPushRecordMain = async (data: InfoPushRecordMainVO) => { |
|||
return await request.post({ url: `/basic/info-push-record-main/create`, data }) |
|||
} |
|||
|
|||
// 修改物料信息推送记录主
|
|||
export const updateInfoPushRecordMain = async (data: InfoPushRecordMainVO) => { |
|||
return await request.put({ url: `/basic/info-push-record-main/update`, data }) |
|||
} |
|||
|
|||
// 删除物料信息推送记录主
|
|||
export const deleteInfoPushRecordMain = async (id: number) => { |
|||
return await request.delete({ url: `/basic/info-push-record-main/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出物料信息推送记录主 Excel
|
|||
export const exportInfoPushRecordMain = async (params) => { |
|||
return await request.download({ url: `/basic/info-push-record-main/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/basic/info-push-record-main/get-import-template' }) |
|||
} |
@ -0,0 +1,59 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface CycleDataSyncVO { |
|||
id: number |
|||
planCode: string |
|||
planDate: localdate |
|||
seq: number |
|||
planQty: number |
|||
configure: string |
|||
siteId: string |
|||
available: string |
|||
concurrencyStamp: number |
|||
deptId: number |
|||
} |
|||
|
|||
// 查询模次数据同步列表
|
|||
export const getCycleDataSyncPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/eam/cycle-data-sync/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/eam/cycle-data-sync/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询模次数据同步详情
|
|||
export const getCycleDataSync = async (id: number) => { |
|||
return await request.get({ url: `/eam/cycle-data-sync/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增模次数据同步
|
|||
export const createCycleDataSync = async (data: CycleDataSyncVO) => { |
|||
return await request.post({ url: `/eam/cycle-data-sync/create`, data }) |
|||
} |
|||
|
|||
// 修改模次数据同步
|
|||
export const updateCycleDataSync = async (data: CycleDataSyncVO) => { |
|||
return await request.put({ url: `/eam/cycle-data-sync/update`, data }) |
|||
} |
|||
|
|||
// 删除模次数据同步
|
|||
export const deleteCycleDataSync = async (id: number) => { |
|||
return await request.delete({ url: `/eam/cycle-data-sync/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出模次数据同步 Excel
|
|||
export const exportCycleDataSync = async (params) => { |
|||
return await request.download({ url: `/eam/cycle-data-sync/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/eam/cycle-data-sync/get-import-template' }) |
|||
} |
|||
|
|||
export const retryCycleDataSync = () => { |
|||
return request.post({ url: '/eam/mold-accounts/retryCycleDataSync'}) |
|||
} |
@ -0,0 +1,74 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const ApplicantInfoConfigRules = reactive({ |
|||
applicant: [required], |
|||
employeeNumber: [required], |
|||
phone: [required], |
|||
concurrencyStamp: [required] |
|||
}) |
|||
|
|||
export const ApplicantInfoConfig = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '申请人', |
|||
field: 'applicant', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '工号', |
|||
field: 'employeeNumber', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '电话', |
|||
field: 'phone', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '描述', |
|||
field: 'describes', |
|||
sort: 'custom', |
|||
form: { |
|||
component: 'Input', |
|||
componentProps: { |
|||
type: 'textarea', |
|||
} |
|||
}, |
|||
}, |
|||
// {
|
|||
// 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: 'available',
|
|||
// sort: 'custom',
|
|||
// isForm: true,
|
|||
// isSearch: true
|
|||
// },
|
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,244 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="ApplicantInfoConfig.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="ApplicantInfoConfig.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="ApplicantInfoConfigRules" |
|||
:formAllSchemas="ApplicantInfoConfig.allSchemas" |
|||
:apiUpdate="ApplicantInfoConfigApi.updateApplicantInfoConfig" |
|||
:apiCreate="ApplicantInfoConfigApi.createApplicantInfoConfig" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="ApplicantInfoConfig.allSchemas" /> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/basic/applicant-info-config/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { ApplicantInfoConfig,ApplicantInfoConfigRules } from './applicantInfoConfig.data' |
|||
import * as ApplicantInfoConfigApi from '@/api/eam/basic/applicantInfoConfig' |
|||
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: 'ApplicantInfoConfig' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(ApplicantInfoConfig.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: ApplicantInfoConfigApi.getApplicantInfoConfigPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'basic:applicant-info-config:create'}), // 新增 |
|||
// defaultButtons.defaultImportBtn({hasPermi:'basic:applicant-info-config:import'}), // 导入 |
|||
// defaultButtons.defaultExportBtn({hasPermi:'basic:applicant-info-config: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:'basic:applicant-info-config:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'basic:applicant-info-config: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 =ApplicantInfoConfig.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 ApplicantInfoConfigApi.createApplicantInfoConfig(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await ApplicantInfoConfigApi.updateApplicantInfoConfig(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, 'basicApplicantInfoConfig') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await ApplicantInfoConfigApi.deleteApplicantInfoConfig(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 ApplicantInfoConfigApi.exportApplicantInfoConfig(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 ApplicantInfoConfigApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,244 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="InfoPushRecordDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="InfoPushRecordDetail.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="InfoPushRecordDetailRules" |
|||
:formAllSchemas="InfoPushRecordDetail.allSchemas" |
|||
:apiUpdate="InfoPushRecordDetailApi.updateInfoPushRecordDetail" |
|||
:apiCreate="InfoPushRecordDetailApi.createInfoPushRecordDetail" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="InfoPushRecordDetail.allSchemas" /> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/basic/info-push-record-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { InfoPushRecordDetail,InfoPushRecordDetailRules } from './infoPushRecordDetail.data' |
|||
import * as InfoPushRecordDetailApi from '@/api/eam/basic/infoPushRecordDetail' |
|||
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: 'InfoPushRecordDetail' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(InfoPushRecordDetail.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: InfoPushRecordDetailApi.getInfoPushRecordDetailPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'basic:info-push-record-detail:create'}), // 新增 |
|||
defaultButtons.defaultImportBtn({hasPermi:'basic:info-push-record-detail:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'basic:info-push-record-detail: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:'basic:info-push-record-detail:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'basic:info-push-record-detail: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 =InfoPushRecordDetail.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 InfoPushRecordDetailApi.createInfoPushRecordDetail(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await InfoPushRecordDetailApi.updateInfoPushRecordDetail(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, 'basicInfoPushRecordDetail') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await InfoPushRecordDetailApi.deleteInfoPushRecordDetail(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 InfoPushRecordDetailApi.exportInfoPushRecordDetail(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 InfoPushRecordDetailApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,137 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const InfoPushRecordDetailRules = reactive({ |
|||
masterId: [required], |
|||
mc: [required], |
|||
wlh: [required], |
|||
concurrencyStamp: [required] |
|||
}) |
|||
|
|||
export const InfoPushRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
|
|||
{ |
|||
label: '名称', |
|||
field: 'mc', |
|||
sort: 'custom', |
|||
table: { |
|||
width:150 |
|||
}, |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '物料号', |
|||
field: 'wlh', |
|||
sort: 'custom', |
|||
table: { |
|||
width:150 |
|||
}, |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '规格型号', |
|||
field: 'ggxh', |
|||
sort: 'custom', |
|||
table: { |
|||
width:150 |
|||
}, |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '数量', |
|||
field: 'sl', |
|||
sort: 'custom', |
|||
isSearch: false |
|||
}, |
|||
{ |
|||
label: '单位', |
|||
field: 'dw', |
|||
sort: 'custom', |
|||
table: { |
|||
width:150 |
|||
}, |
|||
isSearch: false |
|||
}, |
|||
{ |
|||
label: '申请单价', |
|||
field: 'ckdj', |
|||
sort: 'custom', |
|||
table: { |
|||
width:150 |
|||
}, |
|||
isSearch: false |
|||
}, |
|||
{ |
|||
label: '行总价', |
|||
field: 'zj', |
|||
sort: 'custom', |
|||
table: { |
|||
width:150 |
|||
}, |
|||
isSearch: false |
|||
}, |
|||
{ |
|||
label: '库存数', |
|||
field: 'kcs', |
|||
sort: 'custom', |
|||
table: { |
|||
width:150 |
|||
}, |
|||
isSearch: false |
|||
}, |
|||
{ |
|||
label: '财务控制员', |
|||
field: 'financer', |
|||
sort: 'custom', |
|||
table: { |
|||
width:150 |
|||
}, |
|||
isSearch: false |
|||
}, |
|||
{ |
|||
label: '科目代码', |
|||
field: 'subjectCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width:150 |
|||
}, |
|||
isSearch: false |
|||
}, |
|||
{ |
|||
label: '采购员', |
|||
field: 'purchaser', |
|||
sort: 'custom', |
|||
table: { |
|||
width:150 |
|||
}, |
|||
isSearch: false |
|||
}, |
|||
{ |
|||
label: '成本中心', |
|||
field: 'costCenter', |
|||
sort: 'custom', |
|||
table: { |
|||
width:150 |
|||
}, |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '用途', |
|||
field: 'purpose', |
|||
sort: 'custom', |
|||
table: { |
|||
width:150 |
|||
}, |
|||
isSearch: false |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,244 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="InfoPushRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="InfoPushRecordMain.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="InfoPushRecordMainRules" |
|||
:formAllSchemas="InfoPushRecordMain.allSchemas" |
|||
:apiUpdate="InfoPushRecordMainApi.updateInfoPushRecordMain" |
|||
:apiCreate="InfoPushRecordMainApi.createInfoPushRecordMain" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="InfoPushRecordMain.allSchemas" /> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/basic/info-push-record-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { InfoPushRecordMain,InfoPushRecordMainRules } from './infoPushRecordMain.data' |
|||
import * as InfoPushRecordMainApi from '@/api/eam/basic/infoPushRecordMain' |
|||
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: 'InfoPushRecordMain' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(InfoPushRecordMain.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: InfoPushRecordMainApi.getInfoPushRecordMainPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'basic:info-push-record-main:create'}), // 新增 |
|||
defaultButtons.defaultImportBtn({hasPermi:'basic:info-push-record-main:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'basic:info-push-record-main: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:'basic:info-push-record-main:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'basic:info-push-record-main: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 =InfoPushRecordMain.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 InfoPushRecordMainApi.createInfoPushRecordMain(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await InfoPushRecordMainApi.updateInfoPushRecordMain(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, 'basicInfoPushRecordMain') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await InfoPushRecordMainApi.deleteInfoPushRecordMain(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 InfoPushRecordMainApi.exportInfoPushRecordMain(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 InfoPushRecordMainApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,66 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const InfoPushRecordMainRules = reactive({ |
|||
sqr: [required], |
|||
lxdh: [required], |
|||
concurrencyStamp: [required] |
|||
}) |
|||
|
|||
export const InfoPushRecordMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
|
|||
{ |
|||
label: '申请人', |
|||
field: 'sqr', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '收货地点', |
|||
field: 'shdd', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '要求到货时间', |
|||
field: 'yqdhsj', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '联系电话', |
|||
field: 'lxdh', |
|||
sort: 'custom', |
|||
isSearch: false |
|||
}, |
|||
{ |
|||
label: '合计金额', |
|||
field: 'hjje', |
|||
sort: 'custom', |
|||
isSearch: false |
|||
}, |
|||
{ |
|||
label: '推送状态', |
|||
field: 'pushStatus', |
|||
dictType: DICT_TYPE.PUSH_STATUS, |
|||
dictClass: 'string', |
|||
sort: 'custom', |
|||
isSearch: false |
|||
}, |
|||
{ |
|||
label: '描述', |
|||
field: 'describes', |
|||
sort: 'custom', |
|||
isSearch: false |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,145 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const CycleDataSyncRules = reactive({ |
|||
concurrencyStamp: [required] |
|||
}) |
|||
|
|||
export const CycleDataSync = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '主键ID', |
|||
field: 'id', |
|||
sort: 'custom', |
|||
isForm: false |
|||
}, |
|||
{ |
|||
label: '计划号', |
|||
field: 'planCode', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '计划日期', |
|||
field: 'planDate', |
|||
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')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '圈数', |
|||
field: 'seq', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
} |
|||
}, |
|||
{ |
|||
label: '计划数量', |
|||
field: 'planQty', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
} |
|||
}, |
|||
{ |
|||
label: '零件号', |
|||
field: 'configure', |
|||
sort: 'custom', |
|||
isSearch: true |
|||
}, |
|||
{ |
|||
label: '执行状态', |
|||
field: 'status', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.MOLD_TIME_SYNC_STATUS, |
|||
dictClass: 'string', |
|||
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: '地点ID',
|
|||
// field: 'siteId',
|
|||
// sort: 'custom',
|
|||
// isSearch: true
|
|||
// },
|
|||
// {
|
|||
// label: '是否可用',
|
|||
// field: 'available',
|
|||
// sort: 'custom',
|
|||
// dictType: DICT_TYPE.TRUE_FALSE,
|
|||
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|||
// isSearch: true,
|
|||
// form: {
|
|||
// component: 'Switch',
|
|||
// value: 'TRUE',
|
|||
// componentProps: {
|
|||
// inactiveValue: 'FALSE',
|
|||
// activeValue: 'TRUE'
|
|||
// }
|
|||
// }
|
|||
// },
|
|||
// {
|
|||
// label: '并发乐观锁',
|
|||
// field: 'concurrencyStamp',
|
|||
// sort: 'custom',
|
|||
// isSearch: true,
|
|||
// form: {
|
|||
// component: 'InputNumber',
|
|||
// value: 0
|
|||
// }
|
|||
// },
|
|||
// {
|
|||
// label: '部门id',
|
|||
// field: 'deptId',
|
|||
// sort: 'custom',
|
|||
// isSearch: true,
|
|||
// form: {
|
|||
// component: 'InputNumber',
|
|||
// value: 0
|
|||
// }
|
|||
// },
|
|||
// {
|
|||
// label: '操作',
|
|||
// field: 'action',
|
|||
// isForm: false,
|
|||
// table: {
|
|||
// width: 150,
|
|||
// fixed: 'right'
|
|||
// }
|
|||
// }
|
|||
])) |
@ -0,0 +1,253 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="CycleDataSync.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="CycleDataSync.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="CycleDataSyncRules" |
|||
:formAllSchemas="CycleDataSync.allSchemas" |
|||
:apiUpdate="CycleDataSyncApi.updateCycleDataSync" |
|||
:apiCreate="CycleDataSyncApi.createCycleDataSync" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="CycleDataSync.allSchemas" /> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/mold/cycle-data-sync/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { CycleDataSync,CycleDataSyncRules } from './cycleDataSync.data' |
|||
import * as CycleDataSyncApi from '@/api/eam/mold/cycleDataSync' |
|||
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: 'MoldCycleDataSync' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(CycleDataSync.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: CycleDataSyncApi.getCycleDataSyncPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.retryBtn(null), // 新增 |
|||
// defaultButtons.defaultAddBtn({hasPermi:'eam:cycleDataSync:create'}), // 新增 |
|||
// defaultButtons.defaultImportBtn({hasPermi:'eam:cycleDataSync:import'}), // 导入 |
|||
// defaultButtons.defaultExportBtn({hasPermi:'eam:cycleDataSync: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 if (val == 'retry') { // 重试 |
|||
retry() |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn({hasPermi:'eam:cycleDataSync:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'eam:cycleDataSync: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 =CycleDataSync.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 CycleDataSyncApi.createCycleDataSync(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await CycleDataSyncApi.updateCycleDataSync(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, 'basicCycleDataSync') |
|||
} |
|||
|
|||
const retry = async () => { |
|||
await CycleDataSyncApi.retryCycleDataSync() |
|||
message.success(t('common.retrySuccess')) |
|||
getList() |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await CycleDataSyncApi.deleteCycleDataSync(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 CycleDataSyncApi.exportCycleDataSync(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 CycleDataSyncApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
Loading…
Reference in new issue