zhang_li
5 months ago
4 changed files with 407 additions and 12 deletions
@ -0,0 +1,137 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search |
|||
:schema="SparePartsInLocationRecordMain.allSchemas.searchSchema" |
|||
@search="setSearchParams" |
|||
@reset="setSearchParams" |
|||
/> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="SparePartsInLocationRecordMain.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #number="{ row }"> |
|||
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|||
<span>{{ row.number }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase |
|||
:Butttondata="butttondata(row)" |
|||
@button-base-click="buttonTableClick($event, row)" |
|||
/> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail |
|||
ref="detailRef" |
|||
:isBasic="false" |
|||
:allSchemas="SparePartsInLocationRecordMain.allSchemas" |
|||
:detailAllSchemas="SparePartsInLocationRecordDetail.allSchemas" |
|||
:detailAllSchemasRules="SparePartsInLocationRecordDetailRules" |
|||
:apiPage="SparePartsInLocationRecordDetailApi.getSparePartsInLocationRecordDetailPage" |
|||
:isShowAddBtn="false" |
|||
:detailButtonIsShowAdd="false" |
|||
/> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { |
|||
SparePartsInLocationRecordMain, |
|||
SparePartsInLocationRecordDetail, |
|||
SparePartsInLocationRecordDetailRules |
|||
} from './sparePartsInLocationRecordMain.data' |
|||
import * as SparePartsInLocationRecordMainApi from '@/api/eam/sparePartsInLocationRecordMain' |
|||
import * as SparePartsInLocationRecordDetailApi from '@/api/eam/sparePartsInLocationRecordDetail' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|||
|
|||
// 采购订单 |
|||
defineOptions({ name: 'SparepartsinlocationRecord' }) |
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(SparePartsInLocationRecordMain.allSchemas.tableColumns) |
|||
// const audiFormRef = ref() |
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
// 子表新增的时候选择表格之后需要会显得字段 |
|||
const Echo = [] |
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: SparePartsInLocationRecordMainApi.getSparePartsInLocationRecordMainPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
// defaultButtons.defaultAddBtn({ hasPermi: 'eam:spare-parts-in-location-main:create' }), // 新增 |
|||
// defaultButtons.defaultImportBtn({ hasPermi: 'eam:spare-parts-in-location-main:import' }), // 导入 |
|||
// defaultButtons.defaultExportBtn({ hasPermi: 'eam:spare-parts-in-location-main:export' }), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null) // 设置 |
|||
|
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'refresh') { |
|||
// 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { |
|||
// 筛选 |
|||
} else { |
|||
// 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicSparePartsApplyMain') |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
}) |
|||
</script> |
@ -0,0 +1,258 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
import * as ItemAccountsApi from '@/api/eam/itemAccounts' |
|||
import { ItemAccounts } from '@/views/eam/itemAccounts/itemAccounts.data' |
|||
|
|||
|
|||
// 表单校验
|
|||
export const SparePartsInLocationRecordMainRules = reactive({ |
|||
number: [required], |
|||
theme: [required], |
|||
type: [required], |
|||
}) |
|||
// 备件入库主表
|
|||
export const SparePartsInLocationRecordMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: 'id', |
|||
field: 'id', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '编号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '入库主题', |
|||
field: 'theme', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
},{ |
|||
label: '入库类型', |
|||
field: 'type', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.PUT_IN_TYPE, |
|||
dictClass: 'string', |
|||
|
|||
}, |
|||
{ |
|||
label: '流程状态', |
|||
field: 'status', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isForm:false, |
|||
|
|||
dictType: DICT_TYPE.SPAREPARTS_APPLY_STATUS_ENUM, |
|||
dictClass: 'string', |
|||
|
|||
}, |
|||
{ |
|||
label: '入库申请人', |
|||
field: 'applyer', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '审核人', |
|||
field: 'approver', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isForm:false |
|||
}, |
|||
{ |
|||
label: '审核内容', |
|||
field: 'approveContent', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isForm:false |
|||
}, |
|||
{ |
|||
label: '审核时间', |
|||
field: 'approveTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
isForm:false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '入库时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
}, |
|||
|
|||
|
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
])) |
|||
// 备件入库子表
|
|||
export const SparePartsInLocationRecordDetailRules = reactive({ |
|||
number: [required], |
|||
masterId: [required], |
|||
locationCode: [required], |
|||
areaCode: [required], |
|||
sparePartsCode: [required], |
|||
applyQty: [required], |
|||
}) |
|||
|
|||
export const SparePartsInLocationRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '库位编号', |
|||
field: 'locationCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
componentProps: { |
|||
isSearchList: true, // 开启查询弹窗
|
|||
searchListPlaceholder: '请选择库位编号', // 输入框占位文本
|
|||
searchField: 'code', // 查询弹窗赋值字段
|
|||
searchTitle: '库位信息', // 查询弹窗标题
|
|||
|
|||
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
|
|||
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
|
|||
searchCondition: [ |
|||
{ |
|||
key: 'available', |
|||
value: 'TRUE', |
|||
isMainValue: false |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
tableForm: { |
|||
isInpuFocusShow: true, |
|||
searchListPlaceholder: '请选择备件编号', // 输入框占位文本
|
|||
searchField: 'itemNumber', // 查询弹窗赋值字段
|
|||
searchTitle: '备件信息', // 查询弹窗标题
|
|||
|
|||
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
|
|||
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
|
|||
searchCondition: [ |
|||
{ |
|||
key: 'available', |
|||
value: 'TRUE', |
|||
isMainValue: false |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
label: '库区编号', |
|||
field: 'areaCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
tableForm:{ |
|||
disabled: true |
|||
} |
|||
}, |
|||
{ |
|||
label: '备件编号', |
|||
field: 'sparePartsCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
tableForm:{ |
|||
disabled: true |
|||
} |
|||
}, |
|||
{ |
|||
label: '库存数量', |
|||
field: 'currentQty', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
tableForm: { |
|||
disabled: true |
|||
}, |
|||
form:{ |
|||
componentProps:{ |
|||
disabled: true |
|||
} |
|||
}, |
|||
isDetail:false, |
|||
isTable:false |
|||
}, |
|||
{ |
|||
label: '申领数量', |
|||
field: 'applyQty', |
|||
sort: 'custom', |
|||
isSearch: false |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
isTableForm:false |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
|
|||
])) |
|||
|
|||
|
Loading…
Reference in new issue