Browse Source

BUG修改

master
yejiaxing 10 months ago
parent
commit
32b2c8f486
  1. 46
      src/api/eam/item/adjustRecordMain/index.ts
  2. 32
      src/views/eam/item/adjustRecordMain/adjustRecordMain.data.ts
  3. 204
      src/views/eam/item/adjustRecordMain/index.vue
  4. 2
      src/views/eam/item/itemAccounts/itemAccounts.data.ts
  5. 10
      src/views/eam/item/itemApplyMain/itemApplyMain.data.ts
  6. 12
      src/views/eam/item/itemLocationInRecord/itemLocationInRecord.data.ts
  7. 12
      src/views/eam/item/itemLocationOutRecord/itemLocationOutRecord.data.ts
  8. 8
      src/views/eam/item/itemMaintenance/itemMaintenance.data.ts
  9. 10
      src/views/eam/item/itemOrderMain/itemOrderMain.data.ts

46
src/api/eam/item/adjustRecordMain/index.ts

@ -0,0 +1,46 @@
import request from '@/config/axios'
export interface AdjustRecordMainVO {
number: string
planNumber: string
requestNumber: string
requestTime: Date
jobNumber: string
recordNumber: string
}
// 查询备件盘点调整记录主列表
export const getAdjustRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/adjustRecordMain/senior', data })
} else {
return await request.get({ url: `/eam/adjustRecordMain/page`, params })
}
}
// 查询备件盘点调整记录主详情
export const getAdjustRecordMain = async (id: number) => {
return await request.get({ url: `/eam/adjustRecordMain/get?id=` + id })
}
// 新增备件盘点调整记录主
export const createAdjustRecordMain = async (data: AdjustRecordMainVO) => {
return await request.post({ url: `/eam/adjustRecordMain/create`, data })
}
// 修改备件盘点调整记录主
export const updateAdjustRecordMain = async (data: AdjustRecordMainVO) => {
return await request.put({ url: `/eam/adjustRecordMain/update`, data })
}
// 删除备件盘点调整记录主
export const deleteAdjustRecordMain = async (id: number) => {
return await request.delete({ url: `/eam/adjustRecordMain/delete?id=` + id })
}
// 导出备件盘点调整记录主 Excel
export const exportAdjustRecordMain = async (params) => {
return await request.download({ url: `/eam/adjustRecordMain/export-excel`, params })
}

32
src/views/eam/item/adjustRecordMain/adjustRecordMain.data.ts

@ -0,0 +1,32 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const Rules = reactive({
number: [required],
planNumber: [required],
})
export const AdjustRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '备件调整编号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '盘点计划编号',
field: 'planNumber',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

204
src/views/eam/item/adjustRecordMain/index.vue

@ -0,0 +1,204 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="AdjustRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :allSchemas="AdjustRecordMain.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="Rules" :formAllSchemas="AdjustRecordMain.allSchemas"
:apiUpdate="AdjustRecordMainApi.updateAdjustRecordMain" :apiCreate="AdjustRecordMainApi.createAdjustRecordMain" @searchTableSuccess="searchTableSuccess" :isBusiness="false" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="AdjustRecordMain.allSchemas" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { AdjustRecordMain, Rules } from './adjustRecordMain.data'
import * as AdjustRecordMainApi from '@/api/eam/item/adjustRecordMain'
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: 'AdjustRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(AdjustRecordMain.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: AdjustRecordMainApi.getAdjustRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'eam::create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'eam::import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'eam::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: 'eam::update' }), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'eam::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 =AdjustRecordMain.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 AdjustRecordMainApi.createAdjustRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await AdjustRecordMainApi.updateAdjustRecordMain(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, 'basic')
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await AdjustRecordMainApi.deleteAdjustRecordMain(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 AdjustRecordMainApi.exportAdjustRecordMain(tableObject.params)
download.excel(data, '备件盘点调整记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
})
</script>

2
src/views/eam/item/itemAccounts/itemAccounts.data.ts

@ -35,7 +35,7 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isSearch: false,
isTable: true,
sort: 'custom',
table: {

10
src/views/eam/item/itemApplyMain/itemApplyMain.data.ts

@ -10,7 +10,7 @@ const { t } = useI18n() // 国际化
*/
export const ItemApplyMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '申请编号',
label: '领用编号',
field: 'number',
sort: 'custom',
isForm: false,
@ -25,21 +25,21 @@ export const ItemApplyMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'applyId',
sort: 'custom',
isForm: false,
isSearch: true,
isSearch: false,
},
{
label: '审批人',
field: 'approveId',
sort: 'custom',
isForm: false,
isSearch: true,
isSearch: false,
},
{
label: '出库人',
field: 'outId',
sort: 'custom',
isForm: false,
isSearch: true,
isSearch: false,
},
{
label: '描述',
@ -51,7 +51,7 @@ export const ItemApplyMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isSearch: false,
isTable: true,
sort: 'custom',
table: {

12
src/views/eam/item/itemLocationInRecord/itemLocationInRecord.data.ts

@ -13,7 +13,7 @@ export const ItemLocationInRecordRules = reactive({
export const ItemLocationInRecord = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号',
label: '归还编号',
field: 'itemNumber',
sort: 'custom',
isSearch: true,
@ -28,7 +28,7 @@ export const ItemLocationInRecord = useCrudSchemas(reactive<CrudSchema[]>([
field: 'transactionType',
dictType: DICT_TYPE.TRANSACTION_TYPE,
dictClass: 'string',
isSearch: true,
isSearch: false,
isTable: true,
sort: 'custom',
table: {
@ -52,13 +52,13 @@ export const ItemLocationInRecord = useCrudSchemas(reactive<CrudSchema[]>([
label: '库存动作',
field: 'inventoryAction',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
isSearch: true,
isSearch: false,
form: {
component: 'Select'
},
@ -86,7 +86,7 @@ export const ItemLocationInRecord = useCrudSchemas(reactive<CrudSchema[]>([
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
@ -102,7 +102,7 @@ export const ItemLocationInRecord = useCrudSchemas(reactive<CrudSchema[]>([
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isSearch: false,
isTable: true,
sort: 'custom',
table: {

12
src/views/eam/item/itemLocationOutRecord/itemLocationOutRecord.data.ts

@ -13,7 +13,7 @@ export const ItemLocationOutRecordRules = reactive({
export const ItemLocationOutRecord = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号',
label: '出库编号',
field: 'itemNumber',
sort: 'custom',
isSearch: true,
@ -29,7 +29,7 @@ export const ItemLocationOutRecord = useCrudSchemas(reactive<CrudSchema[]>([
field: 'transactionType',
dictType: DICT_TYPE.TRANSACTION_TYPE,
dictClass: 'string',
isSearch: true,
isSearch: false,
isTable: true,
sort: 'custom',
table: {
@ -53,13 +53,13 @@ export const ItemLocationOutRecord = useCrudSchemas(reactive<CrudSchema[]>([
label: '库存动作',
field: 'inventoryAction',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
isSearch: true,
isSearch: false,
form: {
component: 'Select'
},
@ -87,7 +87,7 @@ export const ItemLocationOutRecord = useCrudSchemas(reactive<CrudSchema[]>([
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
@ -103,7 +103,7 @@ export const ItemLocationOutRecord = useCrudSchemas(reactive<CrudSchema[]>([
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isSearch: false,
isTable: true,
sort: 'custom',
table: {

8
src/views/eam/item/itemMaintenance/itemMaintenance.data.ts

@ -11,7 +11,7 @@ export const ItemMaintenanceRules = reactive({
export const ItemMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号',
label: '维修工单编号',
field: 'number',
sort: 'custom',
isSearch: true,
@ -32,7 +32,7 @@ export const ItemMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
field: 'result',
dictType: DICT_TYPE.RESULT,
dictClass: 'string',
isSearch: true,
isSearch: false,
isTable: true,
sort: 'custom',
table: {
@ -57,7 +57,7 @@ export const ItemMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
@ -74,7 +74,7 @@ export const ItemMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isSearch: false,
isTable: true,
sort: 'custom',
table: {

10
src/views/eam/item/itemOrderMain/itemOrderMain.data.ts

@ -10,7 +10,7 @@ const { t } = useI18n() // 国际化
*/
export const ItemOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '申请编号',
label: '采购订单编号',
field: 'number',
sort: 'custom',
isForm: false,
@ -25,21 +25,21 @@ export const ItemOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'applyId',
sort: 'custom',
isForm: false,
isSearch: true,
isSearch: false,
},
{
label: '审批人',
field: 'approveId',
sort: 'custom',
isForm: false,
isSearch: true,
isSearch: false,
},
{
label: '出库人',
field: 'outId',
sort: 'custom',
isForm: false,
isSearch: true,
isSearch: false,
},
{
label: '描述',
@ -51,7 +51,7 @@ export const ItemOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isSearch: false,
isTable: true,
sort: 'custom',
table: {

Loading…
Cancel
Save