55 changed files with 2983 additions and 875 deletions
@ -0,0 +1,61 @@ |
|||||
|
import request from '@/config/axios' |
||||
|
|
||||
|
export interface HolidaySettingVO { |
||||
|
id: number |
||||
|
textOne: string |
||||
|
textTwo: string |
||||
|
textThree: string |
||||
|
textFour: string |
||||
|
textFive: string |
||||
|
deleteTime: Date |
||||
|
status: string |
||||
|
concurrencyStamp: number |
||||
|
remark: string |
||||
|
deleter: string |
||||
|
siteId: number |
||||
|
changeEmplId: number |
||||
|
holidayDate: Date |
||||
|
holidayFlag: string |
||||
|
holidayName: string |
||||
|
} |
||||
|
|
||||
|
// 查询节假日设置列表
|
||||
|
export const getHolidaySettingPage = async (params) => { |
||||
|
if (params.isSearch) { |
||||
|
delete params.isSearch |
||||
|
const data = {...params} |
||||
|
return await request.post({ url: '/mes/holidaySetting/senior', data }) |
||||
|
} else { |
||||
|
return await request.get({ url: `/mes/holidaySetting/page`, params }) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 查询节假日设置详情
|
||||
|
export const getHolidaySetting = async (id: number) => { |
||||
|
return await request.get({ url: `/mes/holidaySetting/get?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 新增节假日设置
|
||||
|
export const createHolidaySetting = async (data: HolidaySettingVO) => { |
||||
|
return await request.post({ url: `/mes/holidaySetting/create`, data }) |
||||
|
} |
||||
|
|
||||
|
// 修改节假日设置
|
||||
|
export const updateHolidaySetting = async (data: HolidaySettingVO) => { |
||||
|
return await request.put({ url: `/mes/holidaySetting/update`, data }) |
||||
|
} |
||||
|
|
||||
|
// 删除节假日设置
|
||||
|
export const deleteHolidaySetting = async (id: number) => { |
||||
|
return await request.delete({ url: `/mes/holidaySetting/delete?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 导出节假日设置 Excel
|
||||
|
export const exportHolidaySetting = async (params) => { |
||||
|
return await request.download({ url: `/mes/holidaySetting/export-excel`, params }) |
||||
|
} |
||||
|
|
||||
|
// 下载用户导入模板
|
||||
|
export const importTemplate = () => { |
||||
|
return request.download({ url: '/mes/holidaySetting/get-import-template' }) |
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
import request from '@/config/axios' |
||||
|
|
||||
|
export interface SamplingProcessVO { |
||||
|
id: number |
||||
|
code: string |
||||
|
describe: string |
||||
|
sampleType: string |
||||
|
evaluationMode: string |
||||
|
sampleSize: number |
||||
|
sampleProgCode: number |
||||
|
available: string |
||||
|
} |
||||
|
|
||||
|
// 查询采样过程列表
|
||||
|
export const getSamplingProcessPage = async (params) => { |
||||
|
if (params.isSearch) { |
||||
|
delete params.isSearch |
||||
|
const data = {...params} |
||||
|
return await request.post({ url: '/qms/sampling-process/senior', data }) |
||||
|
} else { |
||||
|
return await request.get({ url: `/qms/sampling-process/page`, params }) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 查询采样过程详情
|
||||
|
export const getSamplingProcess = async (id: number) => { |
||||
|
return await request.get({ url: `/qms/sampling-process/get?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 新增采样过程
|
||||
|
export const createSamplingProcess = async (data: SamplingProcessVO) => { |
||||
|
return await request.post({ url: `/qms/sampling-process/create`, data }) |
||||
|
} |
||||
|
|
||||
|
// 修改采样过程
|
||||
|
export const updateSamplingProcess = async (data: SamplingProcessVO) => { |
||||
|
return await request.put({ url: `/qms/sampling-process/update`, data }) |
||||
|
} |
||||
|
|
||||
|
// 删除采样过程
|
||||
|
export const deleteSamplingProcess = async (id: number) => { |
||||
|
return await request.delete({ url: `/qms/sampling-process/delete?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 导出采样过程 Excel
|
||||
|
export const exportSamplingProcess = async (params) => { |
||||
|
return await request.download({ url: `/qms/sampling-process/export-excel`, params }) |
||||
|
} |
||||
|
|
||||
|
// 下载用户导入模板
|
||||
|
export const importTemplate = () => { |
||||
|
return request.download({ url: '/qms/sampling-process/get-import-template' }) |
||||
|
} |
@ -0,0 +1,59 @@ |
|||||
|
import request from '@/config/axios' |
||||
|
|
||||
|
export interface AgvLocationrelationVO { |
||||
|
id: number |
||||
|
reqCode: string |
||||
|
positionCode: string |
||||
|
positionArea: string |
||||
|
wmsArea: string |
||||
|
wmsPosition: string |
||||
|
available: string |
||||
|
remark: string |
||||
|
} |
||||
|
|
||||
|
// 查询AGV库位转换列表
|
||||
|
export const getAgvLocationrelationPage = async (params) => { |
||||
|
if (params.isSearch) { |
||||
|
delete params.isSearch |
||||
|
const data = {...params} |
||||
|
return await request.post({ url: '/wms/agv-locationrelation/senior', data }) |
||||
|
} else { |
||||
|
return await request.get({ url: `/wms/agv-locationrelation/page`, params }) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 查询AGV库位转换详情
|
||||
|
export const getAgvLocationrelation = async (id: number) => { |
||||
|
return await request.get({ url: `/wms/agv-locationrelation/get?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 新增AGV库位转换
|
||||
|
export const createAgvLocationrelation = async (data: AgvLocationrelationVO) => { |
||||
|
return await request.post({ url: `/wms/agv-locationrelation/create`, data }) |
||||
|
} |
||||
|
|
||||
|
// 修改AGV库位转换
|
||||
|
export const updateAgvLocationrelation = async (data: AgvLocationrelationVO) => { |
||||
|
return await request.put({ url: `/wms/agv-locationrelation/update`, data }) |
||||
|
} |
||||
|
|
||||
|
// 删除AGV库位转换
|
||||
|
export const deleteAgvLocationrelation = async (id: number) => { |
||||
|
return await request.delete({ url: `/wms/agv-locationrelation/delete?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 导出AGV库位转换 Excel
|
||||
|
export const exportAgvLocationrelation = async (params) => { |
||||
|
if (params.isSearch) { |
||||
|
delete params.isSearch |
||||
|
const data = {...params} |
||||
|
return await request.post({ url: '/wms/agv-locationrelation/export-excel-senior', data }) |
||||
|
} else { |
||||
|
return await request.download({ url: `/wms/agv-locationrelation/export-excel`, params }) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 下载用户导入模板
|
||||
|
export const importTemplate = () => { |
||||
|
return request.download({ url: '/wms/agv-locationrelation/get-import-template' }) |
||||
|
} |
@ -0,0 +1,65 @@ |
|||||
|
import request from '@/config/axios' |
||||
|
|
||||
|
export interface MesBarCodeVO { |
||||
|
id: number |
||||
|
plat: number |
||||
|
counter: string |
||||
|
sign: string |
||||
|
option: string |
||||
|
lowerLim: string |
||||
|
upperLimit: string |
||||
|
itac: string |
||||
|
type: string |
||||
|
lengthBc: number |
||||
|
posMat: string |
||||
|
lengthMat: number |
||||
|
posRevlv: string |
||||
|
partNumber: string |
||||
|
packLabel: string |
||||
|
oesLabel: string |
||||
|
checkRvl: string |
||||
|
days: number |
||||
|
available: string |
||||
|
remark: string |
||||
|
} |
||||
|
|
||||
|
// 查询生产条码清单列表
|
||||
|
export const getMesBarCodePage = async (params) => { |
||||
|
if (params.isSearch) { |
||||
|
delete params.isSearch |
||||
|
const data = {...params} |
||||
|
return await request.post({ url: '/wms/mes-bar-code/senior', data }) |
||||
|
} else { |
||||
|
return await request.get({ url: `/wms/mes-bar-code/page`, params }) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 查询生产条码清单详情
|
||||
|
export const getMesBarCode = async (id: number) => { |
||||
|
return await request.get({ url: `/wms/mes-bar-code/get?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 新增生产条码清单
|
||||
|
export const createMesBarCode = async (data: MesBarCodeVO) => { |
||||
|
return await request.post({ url: `/wms/mes-bar-code/create`, data }) |
||||
|
} |
||||
|
|
||||
|
// 修改生产条码清单
|
||||
|
export const updateMesBarCode = async (data: MesBarCodeVO) => { |
||||
|
return await request.put({ url: `/wms/mes-bar-code/update`, data }) |
||||
|
} |
||||
|
|
||||
|
// 删除生产条码清单
|
||||
|
export const deleteMesBarCode = async (id: number) => { |
||||
|
return await request.delete({ url: `/wms/mes-bar-code/delete?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 导出生产条码清单 Excel
|
||||
|
export const exportMesBarCode = async (params) => { |
||||
|
return await request.download({ url: `/wms/mes-bar-code/export-excel`, params }) |
||||
|
} |
||||
|
|
||||
|
// 下载用户导入模板
|
||||
|
export const importTemplate = () => { |
||||
|
return request.download({ url: '/wms/mes-bar-code/get-import-template' }) |
||||
|
} |
@ -0,0 +1,178 @@ |
|||||
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
||||
|
import { dateFormatter } from '@/utils/formatTime' |
||||
|
|
||||
|
// 表单校验
|
||||
|
export const HolidaySettingRules = reactive({ |
||||
|
concurrencyStamp: [required], |
||||
|
}) |
||||
|
|
||||
|
export const HolidaySetting = useCrudSchemas(reactive<CrudSchema[]>([ |
||||
|
{ |
||||
|
label: 'id', |
||||
|
field: 'id', |
||||
|
sort: 'custom', |
||||
|
isForm: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: '备用字段一', |
||||
|
field: 'textOne', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '备用字段二', |
||||
|
field: 'textTwo', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '备用字段三', |
||||
|
field: 'textThree', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '备用字段四', |
||||
|
field: 'textFour', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '备用字段五', |
||||
|
field: 'textFive', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '删除时间', |
||||
|
field: 'deleteTime', |
||||
|
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: 'status', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
form: { |
||||
|
component: 'Radio' |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '并发乐观锁', |
||||
|
field: 'concurrencyStamp', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
form: { |
||||
|
component: 'InputNumber', |
||||
|
value: 0 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '备注', |
||||
|
field: 'remark', |
||||
|
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: 'deleter', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '位置ID', |
||||
|
field: 'siteId', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
form: { |
||||
|
component: 'InputNumber', |
||||
|
value: 0 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '更改ID', |
||||
|
field: 'changeEmplId', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
form: { |
||||
|
component: 'InputNumber', |
||||
|
value: 0 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '节假日日期', |
||||
|
field: 'holidayDate', |
||||
|
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: 'holidayFlag', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '节假日名称', |
||||
|
field: 'holidayName', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '操作', |
||||
|
field: 'action', |
||||
|
isForm: false, |
||||
|
table: { |
||||
|
width: 150, |
||||
|
fixed: 'right' |
||||
|
} |
||||
|
} |
||||
|
])) |
@ -0,0 +1,245 @@ |
|||||
|
<template> |
||||
|
<ContentWrap> |
||||
|
<!-- 搜索工作栏 --> |
||||
|
<Search :schema="HolidaySetting.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
||||
|
</ContentWrap> |
||||
|
|
||||
|
<!-- 列表头部 --> |
||||
|
<TableHead |
||||
|
:HeadButttondata="HeadButttondata" |
||||
|
@button-base-click="buttonBaseClick" |
||||
|
:routeName="routeName" |
||||
|
@updataTableColumns="updataTableColumns" |
||||
|
@searchFormClick="searchFormClick" |
||||
|
:allSchemas="HolidaySetting.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="HolidaySettingRules" |
||||
|
:formAllSchemas="HolidaySetting.allSchemas" |
||||
|
:apiUpdate="HolidaySettingApi.updateHolidaySetting" |
||||
|
:apiCreate="HolidaySettingApi.createHolidaySetting" |
||||
|
@searchTableSuccess="searchTableSuccess" |
||||
|
:isBusiness="false" |
||||
|
/> |
||||
|
|
||||
|
<!-- 详情 --> |
||||
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="HolidaySetting.allSchemas" /> |
||||
|
|
||||
|
<!-- 导入 --> |
||||
|
<ImportForm ref="importFormRef" url="/mes/holidaySetting/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import download from '@/utils/download' |
||||
|
import { HolidaySetting,HolidaySettingRules } from './holidaySetting.data' |
||||
|
import * as HolidaySettingApi from '@/api/mes/holidaySetting' |
||||
|
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: 'MesHolidaySetting' }) |
||||
|
|
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
const { t } = useI18n() // 国际化 |
||||
|
|
||||
|
const route = useRoute() // 路由信息 |
||||
|
const routeName = ref() |
||||
|
routeName.value = route.name |
||||
|
const tableColumns = ref(HolidaySetting.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: HolidaySettingApi.getHolidaySettingPage // 分页接口 |
||||
|
}) |
||||
|
|
||||
|
// 获得表格的各种操作 |
||||
|
const { getList, setSearchParams } = tableMethods |
||||
|
|
||||
|
// 列表头部按钮 |
||||
|
const HeadButttondata = [ |
||||
|
defaultButtons.defaultAddBtn({hasPermi:'mes:holidaySetting:create'}), // 新增 |
||||
|
defaultButtons.defaultImportBtn({hasPermi:'mes:holidaySetting:import'}), // 导入 |
||||
|
defaultButtons.defaultExportBtn({hasPermi:'mes:holidaySetting: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:holidaySetting:update'}), // 编辑 |
||||
|
defaultButtons.mainListDeleteBtn({hasPermi:'mes:holidaySetting: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 =HolidaySetting.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 HolidaySettingApi.createHolidaySetting(data) |
||||
|
message.success(t('common.createSuccess')) |
||||
|
} else { |
||||
|
await HolidaySettingApi.updateHolidaySetting(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, 'basicHolidaySetting') |
||||
|
} |
||||
|
|
||||
|
/** 删除按钮操作 */ |
||||
|
const handleDelete = async (id: number) => { |
||||
|
try { |
||||
|
// 删除的二次确认 |
||||
|
await message.delConfirm() |
||||
|
// 发起删除 |
||||
|
await HolidaySettingApi.deleteHolidaySetting(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 HolidaySettingApi.exportHolidaySetting(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 HolidaySettingApi.importTemplate() |
||||
|
}) |
||||
|
|
||||
|
</script> |
||||
|
./holidaySetting.data |
@ -1,160 +0,0 @@ |
|||||
<template> |
|
||||
<div class="tableNavBtnsContent" ref="tableNavBtnsContent_Ref"> |
|
||||
<div class="searchBox"> |
|
||||
<div class="tableNavLeftBtns"> |
|
||||
<ButtonBase |
|
||||
:Butttondata="buttonsLeft" |
|
||||
@button-base-click="buttonBaseClick" |
|
||||
/> |
|
||||
</div> |
|
||||
<div class="tableNavRightBtns"> |
|
||||
<!-- 右侧按钮 --> |
|
||||
<ButtonBase :Butttondata="buttonsRight" @button-base-click="buttonBaseClick" @updata-table-columns="updataTableColumns" |
|
||||
:allSchemas="allSchemas" ref="rowDropRef"/> |
|
||||
</div> |
|
||||
</div> |
|
||||
<slot></slot> |
|
||||
</div> |
|
||||
<!-- 字段设置弹窗 --> |
|
||||
<!-- <rowDrop |
|
||||
ref="rowDropRef" |
|
||||
@updata-table-columns="updataTableColumns" |
|
||||
:allSchemas="allSchemas" |
|
||||
/> --> |
|
||||
<!-- 高级筛选 --> |
|
||||
<SearchHigh |
|
||||
ref="searchHigh_Ref" |
|
||||
class="searchHighClass" |
|
||||
:routeName="routeName" |
|
||||
:masterId="masterId" |
|
||||
:showPrimaryBaseButton="false" |
|
||||
@search-form-click="searchFormClick" |
|
||||
:isHighExcludePrimary="false" |
|
||||
:primarySearchCustomButton="[]" |
|
||||
:highSearchCustomButton="[]" |
|
||||
:allSchemas="allSchemas" |
|
||||
/> |
|
||||
</template> |
|
||||
<script setup> |
|
||||
import ButtonBase from '@/components/XButton/src/ButtonBase.vue' |
|
||||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
||||
import rowDrop from "@/components/rowDrop/index.vue" |
|
||||
|
|
||||
const props = defineProps({ |
|
||||
HeadButttondata: { |
|
||||
type: Array, |
|
||||
default: () => { |
|
||||
return [] |
|
||||
} |
|
||||
}, |
|
||||
// 主组件name值 |
|
||||
routeName: { |
|
||||
type: String, |
|
||||
default: '' |
|
||||
}, |
|
||||
// 从子表进行高级搜索 |
|
||||
masterId: { |
|
||||
type: String, |
|
||||
default: '' |
|
||||
}, |
|
||||
allSchemas: { |
|
||||
type: Object, |
|
||||
default: null |
|
||||
} |
|
||||
}) |
|
||||
const buttonsLeft = ref([]) |
|
||||
const buttonsRight = ref([]) |
|
||||
const tableNavBtnsContent_Ref = ref() |
|
||||
|
|
||||
// 更新主列表字段 |
|
||||
const updataTableColumns = (val) => { |
|
||||
emit('updataTableColumns', val) |
|
||||
} |
|
||||
|
|
||||
// const defaultButtons = inject('global').defaultButtons |
|
||||
// 创建左右按钮数据 |
|
||||
const buttonsLeftOrRight = () => { |
|
||||
buttonsRight.value = [] |
|
||||
buttonsLeft.value = [] |
|
||||
// 判断是否有筛选按钮(判断筛选按钮的逻辑位置,影响筛选按钮的位置) |
|
||||
// let _primarySearchOption = primarySearch[props.vueName] |
|
||||
// let _highSearchOption = highSearch[props.vueName] |
|
||||
// if(_primarySearchOption || _highSearchOption){ |
|
||||
// buttonsRight.value.push(defaultButtons.defaultFilterBtn()) |
|
||||
// } |
|
||||
// 父级传参处理左右 |
|
||||
props.HeadButttondata.forEach(item=>{ |
|
||||
if(item.float && item.float == 'right'){ |
|
||||
buttonsRight.value.push(item) |
|
||||
}else{ |
|
||||
buttonsLeft.value.push(item) |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
buttonsLeftOrRight() |
|
||||
|
|
||||
watch( |
|
||||
() => props.HeadButttondata, |
|
||||
() => { |
|
||||
buttonsLeftOrRight() |
|
||||
} |
|
||||
) |
|
||||
|
|
||||
|
|
||||
// 传递给父类 |
|
||||
const emit = defineEmits([ |
|
||||
'buttonBaseClick', |
|
||||
'updataTableColumns', |
|
||||
'searchFormClick' |
|
||||
]) |
|
||||
|
|
||||
// 设置显示隐藏变量 |
|
||||
const rowDropRef = ref() |
|
||||
|
|
||||
|
|
||||
const buttonBaseClick = (val, item) => { |
|
||||
// 设置按钮 |
|
||||
if (val == 'set') { |
|
||||
rowDropRef.value.popoverVisible = !rowDropRef.value.popoverVisible |
|
||||
} else if (val == 'filtrate') { |
|
||||
searchHigh_Ref.value.popoverVisible = true |
|
||||
} else { |
|
||||
emit('buttonBaseClick', val, item) |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
const quicklySearchDom_Ref = ref() |
|
||||
|
|
||||
// 筛选组件 |
|
||||
const searchHigh_Ref = ref(false) |
|
||||
// 高级筛选所有的按钮事件 |
|
||||
const searchFormClick = (searchData) => { |
|
||||
emit('searchFormClick', searchData) |
|
||||
searchHigh_Ref.value.popoverVisible = false |
|
||||
} |
|
||||
|
|
||||
defineExpose({ |
|
||||
tableNavBtnsContent_Ref, |
|
||||
quicklySearchDom_Ref |
|
||||
}) |
|
||||
|
|
||||
</script> |
|
||||
<style lang="scss" scoped> |
|
||||
.tableNavBtnsContent{ |
|
||||
padding-bottom: 10px; |
|
||||
.searchBox{ |
|
||||
display: flex; |
|
||||
justify-content: space-between; |
|
||||
} |
|
||||
.tableNavLeftBtns{ |
|
||||
display: flex; |
|
||||
|
|
||||
margin-left: -5px; |
|
||||
} |
|
||||
.tableNavRightBtns{ |
|
||||
display: flex; |
|
||||
margin-left: 10px; |
|
||||
margin-right: -5px; |
|
||||
} |
|
||||
} |
|
||||
</style> |
|
@ -0,0 +1,267 @@ |
|||||
|
<template> |
||||
|
<ContentWrap> |
||||
|
<!-- 搜索工作栏 --> |
||||
|
<Search :schema="AgvLocationrelation.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
||||
|
</ContentWrap> |
||||
|
|
||||
|
<!-- 列表头部 --> |
||||
|
<TableHead |
||||
|
:HeadButttondata="HeadButttondata" |
||||
|
@button-base-click="buttonBaseClick" |
||||
|
:routeName="routeName" |
||||
|
@updataTableColumns="updataTableColumns" |
||||
|
@searchFormClick="searchFormClick" |
||||
|
:allSchemas="AgvLocationrelation.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 #reqCode="{row}"> |
||||
|
<el-button type="primary" link @click="openDetail(row, '代码', row.reqCode)"> |
||||
|
<span>{{ row.reqCode }}</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="AgvLocationrelationRules" |
||||
|
:formAllSchemas="AgvLocationrelation.allSchemas" |
||||
|
:apiUpdate="AgvLocationrelationApi.updateAgvLocationrelation" |
||||
|
:apiCreate="AgvLocationrelationApi.createAgvLocationrelation" |
||||
|
@searchTableSuccess="searchTableSuccess" |
||||
|
:isBusiness="false" |
||||
|
/> |
||||
|
|
||||
|
<!-- 详情 --> |
||||
|
<Detail |
||||
|
ref="detailRef" |
||||
|
:isBasic="true" |
||||
|
:allSchemas="AgvLocationrelation.allSchemas" |
||||
|
/> |
||||
|
|
||||
|
<!-- 导入 --> |
||||
|
<ImportForm ref="importFormRef" url="/wms/agv-locationrelation/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import download from '@/utils/download' |
||||
|
import { AgvLocationrelation,AgvLocationrelationRules } from './agvLocationrelation.data' |
||||
|
import * as AgvLocationrelationApi from '@/api/wms/agvLocationrelation' |
||||
|
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: 'AgvLocationrelation' }) |
||||
|
|
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
const { t } = useI18n() // 国际化 |
||||
|
|
||||
|
const route = useRoute() // 路由信息 |
||||
|
const routeName = ref() |
||||
|
routeName.value = route.name |
||||
|
const tableColumns = ref(AgvLocationrelation.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: AgvLocationrelationApi.getAgvLocationrelationPage // 分页接口 |
||||
|
}) |
||||
|
|
||||
|
// 获得表格的各种操作 |
||||
|
const { getList, setSearchParams } = tableMethods |
||||
|
|
||||
|
// 列表头部按钮 |
||||
|
const HeadButttondata = [ |
||||
|
defaultButtons.defaultAddBtn({hasPermi:'wms:agv-locationrelation:create'}), // 新增 |
||||
|
defaultButtons.defaultImportBtn({hasPermi:'wms:agv-locationrelation:import'}), // 导入 |
||||
|
defaultButtons.defaultExportBtn({hasPermi:'wms:agv-locationrelation: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:'wms:agv-locationrelation:update'}), // 编辑 |
||||
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:agv-locationrelation: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(type == "update"){ |
||||
|
AgvLocationrelation.allSchemas.formSchema.forEach((item) => { |
||||
|
if (item.field == 'positionCode') { |
||||
|
item.componentProps.disabled = true |
||||
|
} |
||||
|
if (item.field == 'positionArea') { |
||||
|
item.componentProps.disabled = true |
||||
|
} |
||||
|
}) |
||||
|
}else { |
||||
|
AgvLocationrelation.allSchemas.formSchema.forEach((item) => { |
||||
|
if (item.field == 'positionCode') { |
||||
|
item.componentProps.disabled = false |
||||
|
} |
||||
|
if (item.field == 'positionArea') { |
||||
|
item.componentProps.disabled = false |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
basicFormRef.value.open(type, row) |
||||
|
} |
||||
|
|
||||
|
// form表单提交 |
||||
|
const formsSuccess = async (formType,data) => { |
||||
|
var isHave =AgvLocationrelation.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 AgvLocationrelationApi.createAgvLocationrelation(data) |
||||
|
message.success(t('common.createSuccess')) |
||||
|
} else { |
||||
|
await AgvLocationrelationApi.updateAgvLocationrelation(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, 'basicAgvLocationrelation') |
||||
|
} |
||||
|
|
||||
|
/** 删除按钮操作 */ |
||||
|
const handleDelete = async (id: number) => { |
||||
|
try { |
||||
|
// 删除的二次确认 |
||||
|
await message.delConfirm() |
||||
|
// 发起删除 |
||||
|
await AgvLocationrelationApi.deleteAgvLocationrelation(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 AgvLocationrelationApi.exportAgvLocationrelation(tableObject.params) |
||||
|
download.excel(data, 'AGV库位转换.xlsx') |
||||
|
} catch { |
||||
|
} finally { |
||||
|
exportLoading.value = false |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** 导入 */ |
||||
|
const importFormRef = ref() |
||||
|
const handleImport = () => { |
||||
|
importFormRef.value.open() |
||||
|
} |
||||
|
// 导入附件弹窗所需的参数 |
||||
|
const importTemplateData = reactive({ |
||||
|
templateUrl: '', |
||||
|
templateTitle: 'AGV库位转换导入模版.xlsx' |
||||
|
}) |
||||
|
// 导入成功之后 |
||||
|
const importSuccess = () => { |
||||
|
getList() |
||||
|
} |
||||
|
|
||||
|
// 筛选提交 |
||||
|
const searchFormClick = (searchData) => { |
||||
|
tableObject.params = { |
||||
|
isSearch: true, |
||||
|
filters: searchData.filters |
||||
|
} |
||||
|
getList() // 刷新当前列表 |
||||
|
} |
||||
|
|
||||
|
/** 初始化 **/ |
||||
|
onMounted(async () => { |
||||
|
getList() |
||||
|
importTemplateData.templateUrl = await AgvLocationrelationApi.importTemplate() |
||||
|
}) |
||||
|
|
||||
|
</script> |
@ -0,0 +1,244 @@ |
|||||
|
<template> |
||||
|
<ContentWrap> |
||||
|
<!-- 搜索工作栏 --> |
||||
|
<Search :schema="SamplingProcess.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
||||
|
</ContentWrap> |
||||
|
|
||||
|
<!-- 列表头部 --> |
||||
|
<TableHead |
||||
|
:HeadButttondata="HeadButttondata" |
||||
|
@button-base-click="buttonBaseClick" |
||||
|
:routeName="routeName" |
||||
|
@updataTableColumns="updataTableColumns" |
||||
|
@searchFormClick="searchFormClick" |
||||
|
:allSchemas="SamplingProcess.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="SamplingProcessRules" |
||||
|
:formAllSchemas="SamplingProcess.allSchemas" |
||||
|
:apiUpdate="SamplingProcessApi.updateSamplingProcess" |
||||
|
:apiCreate="SamplingProcessApi.createSamplingProcess" |
||||
|
@searchTableSuccess="searchTableSuccess" |
||||
|
:isBusiness="false" |
||||
|
/> |
||||
|
|
||||
|
<!-- 详情 --> |
||||
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="SamplingProcess.allSchemas" /> |
||||
|
|
||||
|
<!-- 导入 --> |
||||
|
<ImportForm ref="importFormRef" url="/qms/sampling-process/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import download from '@/utils/download' |
||||
|
import { SamplingProcess,SamplingProcessRules } from './samplingProcess.data' |
||||
|
import * as SamplingProcessApi from '@/api/qms/samplingProcess' |
||||
|
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: 'SamplingProcess' }) |
||||
|
|
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
const { t } = useI18n() // 国际化 |
||||
|
|
||||
|
const route = useRoute() // 路由信息 |
||||
|
const routeName = ref() |
||||
|
routeName.value = route.name |
||||
|
const tableColumns = ref(SamplingProcess.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: SamplingProcessApi.getSamplingProcessPage // 分页接口 |
||||
|
}) |
||||
|
|
||||
|
// 获得表格的各种操作 |
||||
|
const { getList, setSearchParams } = tableMethods |
||||
|
|
||||
|
// 列表头部按钮 |
||||
|
const HeadButttondata = [ |
||||
|
defaultButtons.defaultAddBtn({hasPermi:'wms:samplingProcess:create'}), // 新增 |
||||
|
defaultButtons.defaultImportBtn({hasPermi:'wms:samplingProcess:import'}), // 导入 |
||||
|
defaultButtons.defaultExportBtn({hasPermi:'wms:samplingProcess: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:'wms:samplingProcess:update'}), // 编辑 |
||||
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:samplingProcess: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 =SamplingProcess.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 SamplingProcessApi.createSamplingProcess(data) |
||||
|
message.success(t('common.createSuccess')) |
||||
|
} else { |
||||
|
await SamplingProcessApi.updateSamplingProcess(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, 'basicSamplingProcess') |
||||
|
} |
||||
|
|
||||
|
/** 删除按钮操作 */ |
||||
|
const handleDelete = async (id: number) => { |
||||
|
try { |
||||
|
// 删除的二次确认 |
||||
|
await message.delConfirm() |
||||
|
// 发起删除 |
||||
|
await SamplingProcessApi.deleteSamplingProcess(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 SamplingProcessApi.exportSamplingProcess(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 SamplingProcessApi.importTemplate() |
||||
|
}) |
||||
|
|
||||
|
</script> |
@ -0,0 +1,84 @@ |
|||||
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
||||
|
import { dateFormatter } from '@/utils/formatTime' |
||||
|
|
||||
|
// 表单校验
|
||||
|
export const SamplingProcessRules = reactive({ |
||||
|
code: [required], |
||||
|
sampleType: [required], |
||||
|
evaluationMode: [required], |
||||
|
available: [required], |
||||
|
}) |
||||
|
|
||||
|
export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([ |
||||
|
{ |
||||
|
label: 'id', |
||||
|
field: 'id', |
||||
|
sort: 'custom', |
||||
|
isTable: false, |
||||
|
isForm: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: '编码', |
||||
|
field: 'code', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '描述', |
||||
|
field: 'describe', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
}, |
||||
|
{ |
||||
|
label: '取样类型', |
||||
|
field: 'sampleType', |
||||
|
sort: 'custom', |
||||
|
dictType: DICT_TYPE.SAMPLING_TYPE, |
||||
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
||||
|
isSearch: true, |
||||
|
form: { |
||||
|
component: 'SelectV2' |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '评估模式', |
||||
|
field: 'evaluationMode', |
||||
|
sort: 'custom', |
||||
|
dictType: DICT_TYPE.EVALUATION_MODE, |
||||
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
||||
|
form: { |
||||
|
component: 'SelectV2' |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '样品量', |
||||
|
field: 'sampleSize', |
||||
|
sort: 'custom', |
||||
|
}, |
||||
|
{ |
||||
|
label: '采样方案编码', |
||||
|
field: 'sampleProgCode', |
||||
|
sort: 'custom', |
||||
|
}, |
||||
|
{ |
||||
|
label: '是否可用', |
||||
|
field: 'available', |
||||
|
sort: 'custom', |
||||
|
}, |
||||
|
{ |
||||
|
label: '创建时间', |
||||
|
field: 'createTime', |
||||
|
sort: 'custom', |
||||
|
formatter: dateFormatter, |
||||
|
isForm: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: '操作', |
||||
|
field: 'action', |
||||
|
isForm: false, |
||||
|
table: { |
||||
|
width: 150, |
||||
|
fixed: 'right' |
||||
|
} |
||||
|
} |
||||
|
])) |
@ -0,0 +1,151 @@ |
|||||
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
||||
|
import { dateFormatter } from '@/utils/formatTime' |
||||
|
import * as AreaApi from '@/api/wms/areabasic' |
||||
|
import { Area } from '@/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data' |
||||
|
import * as LocationApi from '@/api/wms/location' |
||||
|
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' |
||||
|
|
||||
|
// 表单校验
|
||||
|
export const AgvLocationrelationRules = reactive({ |
||||
|
positionCode: [ |
||||
|
{ required: true, message: '请填写AGV点位', trigger: 'change' } |
||||
|
], |
||||
|
positionArea: [ |
||||
|
{ required: true, message: '请填写AGV库区', trigger: 'change' } |
||||
|
], |
||||
|
wmsArea: [ |
||||
|
{ required: true, message: '请填写WMS库区', trigger: 'change' } |
||||
|
], |
||||
|
wmsPosition: [ |
||||
|
{ required: true, message: '请填写WMS库位', trigger: 'change' } |
||||
|
] |
||||
|
}) |
||||
|
|
||||
|
export const AgvLocationrelation = useCrudSchemas(reactive<CrudSchema[]>([ |
||||
|
{ |
||||
|
label: '单据号', |
||||
|
field: 'reqCode', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
isForm: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'AGV点位', |
||||
|
field: 'positionCode', |
||||
|
sort: 'custom', |
||||
|
isSearch: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'AGV库区', |
||||
|
field: 'positionArea', |
||||
|
sort: 'custom', |
||||
|
isSearch: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'WMS库区', |
||||
|
field: 'wmsArea', |
||||
|
sort: 'custom', |
||||
|
isSearch: false, |
||||
|
form: { |
||||
|
// labelMessage: '信息提示说明!!!',
|
||||
|
componentProps: { |
||||
|
isSearchList: true, // 开启查询弹窗
|
||||
|
searchListPlaceholder: '请选择库区代码', // 输入框占位文本
|
||||
|
searchField: 'code', // 查询弹窗赋值字段
|
||||
|
searchTitle: '库区信息', // 查询弹窗标题
|
||||
|
searchAllSchemas: Area.allSchemas, // 查询弹窗所需类
|
||||
|
searchPage: AreaApi.getAreaPage, // 查询弹窗所需分页方法
|
||||
|
searchCondition: [{ |
||||
|
key: 'available', |
||||
|
value: 'TRUE', |
||||
|
isMainValue: false |
||||
|
}] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: 'WMS库位', |
||||
|
field: 'wmsPosition', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
form: { |
||||
|
// labelMessage: '信息提示说明!!!',
|
||||
|
componentProps: { |
||||
|
isSearchList: true, // 开启查询弹窗
|
||||
|
searchListPlaceholder: '请选择库位代码', // 输入框占位文本
|
||||
|
searchField: 'code', // 查询弹窗赋值字段
|
||||
|
searchTitle: '库位信息', // 查询弹窗标题
|
||||
|
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
|
||||
|
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
|
||||
|
searchCondition: [{ |
||||
|
key: 'available', |
||||
|
value: 'TRUE', |
||||
|
isMainValue: false |
||||
|
}, |
||||
|
{ |
||||
|
key: 'areaCode', |
||||
|
value: "wmsArea", |
||||
|
message: '请选择库区代码!', |
||||
|
isMainValue: true |
||||
|
}] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '是否可用', |
||||
|
field: 'available', |
||||
|
dictType: DICT_TYPE.TRUE_FALSE, |
||||
|
dictClass: 'string', |
||||
|
isTable: true, |
||||
|
isSearch: false, |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
form: { |
||||
|
component: 'Switch', |
||||
|
value: 'TRUE', |
||||
|
componentProps: { |
||||
|
inactiveValue: 'FALSE', |
||||
|
activeValue: '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')] |
||||
|
} |
||||
|
}, |
||||
|
detail: { |
||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
|
}, |
||||
|
isForm: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: '备注', |
||||
|
field: 'remark', |
||||
|
sort: 'custom', |
||||
|
isSearch: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: '操作', |
||||
|
field: 'action', |
||||
|
isForm: false, |
||||
|
isDetail: false, |
||||
|
table: { |
||||
|
width: 150, |
||||
|
fixed: 'right' |
||||
|
} |
||||
|
} |
||||
|
])) |
@ -0,0 +1,10 @@ |
|||||
|
<template> |
||||
|
<ContentWrap> |
||||
|
11 |
||||
|
</ContentWrap> |
||||
|
|
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
|
||||
|
</script> |
@ -0,0 +1,233 @@ |
|||||
|
<template> |
||||
|
<ContentWrap> |
||||
|
<!-- 搜索工作栏 --> |
||||
|
<Search :schema="MesBarCode.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
||||
|
</ContentWrap> |
||||
|
|
||||
|
<!-- 列表头部 --> |
||||
|
<TableHead |
||||
|
:HeadButttondata="HeadButttondata" |
||||
|
@button-base-click="buttonBaseClick" |
||||
|
:routeName="routeName" |
||||
|
@updataTableColumns="updataTableColumns" |
||||
|
@searchFormClick="searchFormClick" |
||||
|
:allSchemas="MesBarCode.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 #plnt="{row}"> |
||||
|
<el-button type="primary" link @click="openDetail(row, '代码', row.plnt)"> |
||||
|
<span>{{ row.plnt }}</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="MesBarCodeRules" |
||||
|
:formAllSchemas="MesBarCode.allSchemas" |
||||
|
:apiUpdate="MesBarCodeApi.updateMesBarCode" |
||||
|
:apiCreate="MesBarCodeApi.createMesBarCode" |
||||
|
@searchTableSuccess="searchTableSuccess" |
||||
|
:isBusiness="false" |
||||
|
/> |
||||
|
|
||||
|
<!-- 详情 --> |
||||
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="MesBarCode.allSchemas" /> |
||||
|
|
||||
|
<!-- 导入 --> |
||||
|
<ImportForm ref="importFormRef" url="/wms/mes-bar-code/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import download from '@/utils/download' |
||||
|
import { MesBarCode,MesBarCodeRules } from './mesBarCode.data' |
||||
|
import * as MesBarCodeApi from '@/api/wms/mesBarCode' |
||||
|
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: 'MesBarCode' }) |
||||
|
|
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
const { t } = useI18n() // 国际化 |
||||
|
|
||||
|
const route = useRoute() // 路由信息 |
||||
|
const routeName = ref() |
||||
|
routeName.value = route.name |
||||
|
const tableColumns = ref(MesBarCode.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: MesBarCodeApi.getMesBarCodePage // 分页接口 |
||||
|
}) |
||||
|
|
||||
|
// 获得表格的各种操作 |
||||
|
const { getList, setSearchParams } = tableMethods |
||||
|
|
||||
|
// 列表头部按钮 |
||||
|
const HeadButttondata = [ |
||||
|
defaultButtons.defaultAddBtn({hasPermi:'wms:mes-bar-code:create'}), // 新增 |
||||
|
defaultButtons.defaultImportBtn({hasPermi:'wms:mes-bar-code:import'}), // 导入 |
||||
|
defaultButtons.defaultExportBtn({hasPermi:'wms:mes-bar-code: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:'wms:mes-bar-code:update'}), // 编辑 |
||||
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:mes-bar-code:delete'}), // 删除 |
||||
|
] |
||||
|
|
||||
|
// 列表-操作按钮事件 |
||||
|
const buttonTableClick = async (val, row) => { |
||||
|
if (val == 'edit') { // 编辑 |
||||
|
openForm('update', row) |
||||
|
} else if (val == 'delete') { // 删除 |
||||
|
handleDelete(row.id) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** 添加/修改操作 */ |
||||
|
const basicFormRef = ref() |
||||
|
const openForm = (type: string, row?: any) => { |
||||
|
basicFormRef.value.open(type, row) |
||||
|
} |
||||
|
|
||||
|
// form表单提交 |
||||
|
const formsSuccess = async (formType,data) => { |
||||
|
if (formType === 'create') { |
||||
|
await MesBarCodeApi.createMesBarCode(data) |
||||
|
message.success(t('common.createSuccess')) |
||||
|
} else { |
||||
|
await MesBarCodeApi.updateMesBarCode(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, 'basicMesBarCode') |
||||
|
} |
||||
|
|
||||
|
/** 删除按钮操作 */ |
||||
|
const handleDelete = async (id: number) => { |
||||
|
try { |
||||
|
// 删除的二次确认 |
||||
|
await message.delConfirm() |
||||
|
// 发起删除 |
||||
|
await MesBarCodeApi.deleteMesBarCode(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 MesBarCodeApi.exportMesBarCode(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 MesBarCodeApi.importTemplate() |
||||
|
}) |
||||
|
|
||||
|
</script> |
@ -0,0 +1,209 @@ |
|||||
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
||||
|
import { dateFormatter } from '@/utils/formatTime' |
||||
|
|
||||
|
// 表单校验
|
||||
|
export const MesBarCodeRules = reactive({ |
||||
|
available: [required], |
||||
|
}) |
||||
|
|
||||
|
export const MesBarCode = useCrudSchemas(reactive<CrudSchema[]>([ |
||||
|
{ |
||||
|
label: 'Plnt', |
||||
|
field: 'plnt', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 120 |
||||
|
}, |
||||
|
form: { |
||||
|
component: 'InputNumber', |
||||
|
value: 0 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'Counter', |
||||
|
field: 'counter', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
isSearch:true |
||||
|
}, |
||||
|
{ |
||||
|
label: 'SIGN', |
||||
|
field: 'sign', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 120 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'Option', |
||||
|
field: 'option', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 120 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'Lower Lim.', |
||||
|
field: 'lowerLim', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'UpperLimit', |
||||
|
field: 'upperLimit', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'ITAC', |
||||
|
field: 'itac', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 120 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'Type', |
||||
|
field: 'type', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 120 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'Length BC', |
||||
|
field: 'lengthBc', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
form: { |
||||
|
component: 'InputNumber', |
||||
|
value: 0 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'Pos. mat', |
||||
|
field: 'posMat', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'Length mat', |
||||
|
field: 'lengthMat', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
form: { |
||||
|
component: 'InputNumber', |
||||
|
value: 0 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'Pos. revlv', |
||||
|
field: 'posRevlv', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'Part number', |
||||
|
field: 'partNumber', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'Pack Label', |
||||
|
field: 'packLabel', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'OES-Label', |
||||
|
field: 'oesLabel', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'Check Rvl', |
||||
|
field: 'checkRvl', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 150 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: 'Days', |
||||
|
field: 'days', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 120 |
||||
|
}, |
||||
|
form: { |
||||
|
component: 'InputNumber', |
||||
|
value: 0 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '是否可用', |
||||
|
field: 'available', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 120 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '创建时间', |
||||
|
field: 'createTime', |
||||
|
sort: 'custom', |
||||
|
formatter: dateFormatter, |
||||
|
table: { |
||||
|
width: 180 |
||||
|
}, |
||||
|
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')] |
||||
|
} |
||||
|
}, |
||||
|
detail: { |
||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
|
}, |
||||
|
isForm: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: '备注', |
||||
|
field: 'remark', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 120 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '操作', |
||||
|
field: 'action', |
||||
|
isForm: false, |
||||
|
table: { |
||||
|
width: 150, |
||||
|
fixed: 'right' |
||||
|
} |
||||
|
} |
||||
|
])) |
Loading…
Reference in new issue