Browse Source

BUG修改

master
yejiaxing 10 months ago
parent
commit
b89cb56a87
  1. 40
      src/api/eam/item/applicationRecordDetail/index.ts
  2. 14
      src/api/eam/item/applicationRecordMain/index.ts
  3. 51
      src/api/eam/item/countadjustWork/index.ts
  4. 8
      src/views/eam/item/applicationRecord/applicationRecordMain.data.ts
  5. 53
      src/views/eam/item/applicationRecord/index.vue
  6. 52
      src/views/eam/item/countadjustWork/countadjustWork.data.ts
  7. 244
      src/views/eam/item/countadjustWork/index.vue
  8. 2
      src/views/eam/item/itemApplyMain/index.vue
  9. 2
      src/views/eam/item/itemOrderMain/index.vue
  10. 13
      src/views/eam/item/itemOrderMain/itemOrderMain.data.ts

40
src/api/eam/item/applicationRecordDetail/index.ts

@ -1,25 +1,25 @@
import request from '@/config/axios' import request from '@/config/axios'
export interface ItemApplyDetailVO { export interface ItemApplyDetailVO {
number: string number : string
name: string name : string
type: string type : string
applyId: number applyId : number
applyDeptId: number applyDeptId : number
approveId: number approveId : number
approveTime: Date approveTime : Date
outId: number outId : number
outTime: Date outTime : Date
siteId: string siteId : string
available: string available : string
concurrencyStamp: number concurrencyStamp : number
} }
// 查询备件申领记录主列表 // 查询备件申领记录主列表
export const getItemApplyDetailPage = async (params) => { export const getApplicationRecordDetailPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = { ...params }
return await request.post({ url: '/eam/item-apply-detail/senior', data }) return await request.post({ url: '/eam/item-apply-detail/senior', data })
} else { } else {
return await request.get({ url: `/eam/item-apply-detail/page`, params }) return await request.get({ url: `/eam/item-apply-detail/page`, params })
@ -27,31 +27,31 @@ export const getItemApplyDetailPage = async (params) => {
} }
// 查询备件申领记录主详情 // 查询备件申领记录主详情
export const getItemApplyDetail = async (id: number) => { export const getApplicationRecordDetail = async (id : number) => {
return await request.get({ url: `/eam/item-apply-detail/get?id=` + id }) return await request.get({ url: `/eam/item-apply-detail/get?id=` + id })
} }
// 新增备件申领记录主 // 新增备件申领记录主
export const createItemApplyDetail = async (data: ItemApplyDetailVO) => { export const createApplicationRecordDetail = async (data : ItemApplyDetailVO) => {
return await request.post({ url: `/eam/item-apply-detail/create`, data }) return await request.post({ url: `/eam/item-apply-detail/create`, data })
} }
// 修改备件申领记录主 // 修改备件申领记录主
export const updateItemApplyDetail = async (data: ItemApplyDetailVO) => { export const updateApplicationRecordDetail = async (data : ItemApplyDetailVO) => {
return await request.put({ url: `/eam/item-apply-detail/update`, data }) return await request.put({ url: `/eam/item-apply-detail/update`, data })
} }
// 删除备件申领记录主 // 删除备件申领记录主
export const deleteItemApplyDetail = async (id: number) => { export const deleteApplicationRecordDetail = async (id : number) => {
return await request.delete({ url: `/eam/item-apply-detail/delete?id=` + id }) return await request.delete({ url: `/eam/item-apply-detail/delete?id=` + id })
} }
// 导出备件申领记录主 Excel // 导出备件申领记录主 Excel
export const exportItemApplyDetail = async (params) => { export const exportApplicationRecordDetail = async (params) => {
return await request.download({ url: `/eam/item-apply-detail/export-excel`, params }) return await request.download({ url: `/eam/item-apply-detail/export-excel`, params })
} }
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/eam/item-apply-detail/get-import-template' }) return request.download({ url: '/eam/item-apply-detail/get-import-template' })
} }

14
src/api/eam/item/applicationRecordMain/index.ts

@ -16,7 +16,7 @@ export interface ItemApplyMainVO {
} }
// 查询备件申领记录主列表 // 查询备件申领记录主列表
export const getItemApplyMainPage = async (params) => { export const getApplicationRecordMainPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
@ -27,31 +27,31 @@ export const getItemApplyMainPage = async (params) => {
} }
// 查询备件申领记录主详情 // 查询备件申领记录主详情
export const getItemApplyMain = async (id: number) => { export const getApplicationRecordMain = async (id: number) => {
return await request.get({ url: `/eam/item-apply-main/get?id=` + id }) return await request.get({ url: `/eam/item-apply-main/get?id=` + id })
} }
// 新增备件申领记录主 // 新增备件申领记录主
export const createItemApplyMain = async (data: ItemApplyMainVO) => { export const createApplicationRecordMain = async (data: ItemApplyMainVO) => {
return await request.post({ url: `/eam/item-apply-main/create`, data }) return await request.post({ url: `/eam/item-apply-main/create`, data })
} }
// 修改备件申领记录主 // 修改备件申领记录主
export const updateItemApplyMain = async (data: ItemApplyMainVO) => { export const updateApplicationRecordMain = async (data: ItemApplyMainVO) => {
return await request.put({ url: `/eam/item-apply-main/update`, data }) return await request.put({ url: `/eam/item-apply-main/update`, data })
} }
// 删除备件申领记录主 // 删除备件申领记录主
export const deleteItemApplyMain = async (id: number) => { export const deleteApplicationRecordMain = async (id: number) => {
return await request.delete({ url: `/eam/item-apply-main/delete?id=` + id }) return await request.delete({ url: `/eam/item-apply-main/delete?id=` + id })
} }
// 导出备件申领记录主 Excel // 导出备件申领记录主 Excel
export const exportItemApplyMain = async (params) => { export const exportApplicationRecordMain = async (params) => {
return await request.download({ url: `/eam/item-apply-main/export-excel`, params }) return await request.download({ url: `/eam/item-apply-main/export-excel`, params })
} }
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/eam/item-apply-main/get-import-template' }) return request.download({ url: '/eam/item-apply-main/get-import-template' })
} }

51
src/api/eam/item/countadjustWork/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface CountadjustPlanVO {
id : number
number : string
name : string
classification : string
isInAccount : string
status : string
}
// 查询备件盘点计划列表
export const getCountadjustWorkPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/eam/countadjust-plan/senior', data })
} else {
return await request.get({ url: `/eam/countadjust-plan/page`, params })
}
}
// 查询备件盘点计划详情
export const getCountadjustWork = async (id : number) => {
return await request.get({ url: `/eam/countadjust-plan/get?id=` + id })
}
// 新增备件盘点计划
export const createCountadjustWork = async (data : CountadjustPlanVO) => {
return await request.post({ url: `/eam/countadjust-plan/create`, data })
}
// 修改备件盘点计划
export const updateCountadjustWork = async (data : CountadjustPlanVO) => {
return await request.put({ url: `/eam/countadjust-plan/update`, data })
}
// 删除备件盘点计划
export const deleteCountadjustWork = async (id : number) => {
return await request.delete({ url: `/eam/countadjust-plan/delete?id=` + id })
}
// 导出备件盘点计划 Excel
export const exportCountadjustWork = async (params) => {
return await request.download({ url: `/eam/countadjust-plan/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/countadjust-plan/get-import-template' })
}

8
src/views/eam/item/applicationRecord/itemApplyMain.data.ts → src/views/eam/item/applicationRecord/applicationRecordMain.data.ts

@ -8,7 +8,7 @@ const { t } = useI18n() // 国际化
/** /**
* @returns {Array} * @returns {Array}
*/ */
export const ItemApplyMain = useCrudSchemas(reactive<CrudSchema[]>([ export const ApplicationRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '领用编号', label: '领用编号',
field: 'number', field: 'number',
@ -84,7 +84,7 @@ export const ItemApplyMain = useCrudSchemas(reactive<CrudSchema[]>([
])) ]))
//表单校验 //表单校验
export const ItemApplyMainRules = reactive({ export const ApplicationRecordMainRules = reactive({
name: [ name: [
{ required: true, message: '请填写描述', trigger: 'change' } { required: true, message: '请填写描述', trigger: 'change' }
], ],
@ -99,7 +99,7 @@ export const ItemApplyMainRules = reactive({
/** /**
* @returns {Array} * @returns {Array}
*/ */
export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const ApplicationRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '备件编号', label: '备件编号',
field: 'itemNumber', field: 'itemNumber',
@ -216,7 +216,7 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
])) ]))
//表单校验 //表单校验
export const ItemApplyDetailRules = reactive({ export const ApplicationRecordDetailRules = reactive({
lineNumber: [ lineNumber: [
{ required: true, message: '请输入行号', trigger: 'blur' }, { required: true, message: '请输入行号', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } { max: 50, message: '不得超过50个字符', trigger: 'blur' }

53
src/views/eam/item/applicationRecord/index.vue

@ -1,13 +1,14 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="ItemApplyMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search :schema="ApplicationRecordMain.allSchemas.searchSchema" @search="setSearchParams"
@reset="setSearchParams" />
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" <TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" @updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="ItemApplyMain.allSchemas" /> :allSchemas="ApplicationRecordMain.allSchemas" />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
@ -27,17 +28,21 @@
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm ref="formRef" @success="getList" :rules="ItemApplyMainRules" :formAllSchemas="ItemApplyMain.allSchemas" <BasicForm ref="formRef" @success="getList" :rules="ApplicationRecordMainRules"
:tableAllSchemas="ItemApplyDetail.allSchemas" :tableFormRules="ItemApplyDetailRules" :tableData="tableData" :formAllSchemas="ApplicationRecordMain.allSchemas" :tableAllSchemas="ApplicationRecordDetail.allSchemas"
:apiUpdate="ItemApplyMainApi.updateItemApplyMain" :apiCreate="ItemApplyMainApi.createItemApplyMain" :tableFormRules="ApplicationRecordDetailRules" :tableData="tableData"
:isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" :apiUpdate="ApplicationRecordMainApi.updateApplicationRecordMain"
@searchTableSuccess="searchTableSuccess" @submitForm="submitForm" /> :apiCreate="ApplicationRecordMainApi.createApplicationRecordMain" :isBusiness="true"
@handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" />
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="ItemApplyMain.allSchemas" <Detail ref="detailRef" :isBasic="false" :allSchemas="ApplicationRecordMain.allSchemas"
:detailAllSchemas="ItemApplyDetail.allSchemas" :detailAllSchemasRules="ItemApplyDetailRules" :detailAllSchemas="ApplicationRecordDetail.allSchemas" :detailAllSchemasRules="ApplicationRecordDetailRules"
:apiCreate="ItemApplyDetailApi.createItemApplyDetail" :apiUpdate="ItemApplyDetailApi.updateItemApplyDetail" :apiCreate="ApplicationRecordDetailApi.createApplicationRecordDetail"
:apiPage="ItemApplyDetailApi.getItemApplyDetailPage" :apiDelete="ItemApplyDetailApi.deleteItemApplyDetail" :apiUpdate="ApplicationRecordDetailApi.updateApplicationRecordDetail"
:apiPage="ApplicationRecordDetailApi.getApplicationRecordDetailPage"
:apiDelete="ApplicationRecordDetailApi.deleteApplicationRecordDetail"
@searchTableSuccessDetail="searchTableSuccessDetail" /> @searchTableSuccessDetail="searchTableSuccessDetail" />
<!-- 导入 --> <!-- 导入 -->
@ -47,22 +52,22 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { ItemApplyMain, ItemApplyMainRules, ItemApplyDetail, ItemApplyDetailRules } from './itemApplyMain.data' import { ApplicationRecordMain, ApplicationRecordMainRules, ApplicationRecordDetail, ApplicationRecordDetailRules } from './applicationRecordMain.data'
import * as ItemApplyMainApi from '@/api/eam/item/itemApplyMain' import * as ApplicationRecordMainApi from '@/api/eam/item/applicationRecordMain'
import * as ItemApplyDetailApi from '@/api/eam/item/itemApplyDetail' import * as ApplicationRecordDetailApi from '@/api/eam/item/applicationRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
// //
defineOptions({ name: 'ItemApplyMain' }) defineOptions({ name: 'ApplicationRecord' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(ItemApplyMain.allSchemas.tableColumns) const tableColumns = ref(ApplicationRecordMain.allSchemas.tableColumns)
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
@ -106,7 +111,7 @@
const Echo = [] const Echo = []
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: ItemApplyMainApi.getItemApplyMainPage // getListApi: ApplicationRecordMainApi.getApplicationRecordMainPage //
}) })
// //
@ -182,7 +187,7 @@
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => { const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicItemApplyMain') detailRef.value.openDetail(row, titleName, titleValue, 'basicApplicationRecordMain')
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
@ -191,7 +196,7 @@
// //
await message.delConfirm() await message.delConfirm()
// //
await ItemApplyMainApi.deleteItemApplyMain(id) await ApplicationRecordMainApi.deleteApplicationRecordMain(id)
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()
@ -206,7 +211,7 @@
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const data = await ItemApplyMainApi.exportItemApplyMain(tableObject.params) const data = await ApplicationRecordMainApi.exportApplicationRecordMain(tableObject.params)
download.excel(data, '备件申领记录主.xlsx') download.excel(data, '备件申领记录主.xlsx')
} catch { } catch {
} finally { } finally {
@ -218,7 +223,7 @@
* tableForm方法 * tableForm方法
*/ */
const tableFormKeys = {} const tableFormKeys = {}
ItemApplyDetail.allSchemas.tableFormColumns.forEach(item => { ApplicationRecordDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : '' tableFormKeys[item.field] = item.default ? item.default : ''
}) })
const tableData = ref([]) const tableData = ref([])
@ -237,10 +242,10 @@
data.subList = tableData.value // data.subList = tableData.value //
try { try {
if (formType === 'create') { if (formType === 'create') {
await ItemApplyMainApi.createItemApplyMain(data) await ApplicationRecordMainApi.createApplicationRecordMain(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await ItemApplyMainApi.updateItemApplyMain(data) await ApplicationRecordMainApi.updateApplicationRecordMain(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
formRef.value.dialogVisible = false formRef.value.dialogVisible = false
@ -280,6 +285,6 @@
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await ItemApplyMainApi.importTemplate() importTemplateData.templateUrl = await ApplicationRecordMainApi.importTemplate()
}) })
</script> </script>

52
src/views/eam/item/countadjustWork/countadjustWork.data.ts

@ -0,0 +1,52 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
// 表单校验
export const CountadjustWorkRules = reactive({
number: [required],
name: [required],
})
export const CountadjustWork = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '计划编号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '盘点类型',
field: 'classification',
sort: 'custom',
isSearch: false,
},
{
label: '是否账内库',
field: 'isInAccount',
sort: 'custom',
isSearch: false,
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: false,
form: {
component: 'Radio'
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

244
src/views/eam/item/countadjustWork/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CountadjustWork.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CountadjustWork.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="CountadjustWorkRules"
:formAllSchemas="CountadjustWork.allSchemas"
:apiUpdate="CountadjustWorkApi.updateCountadjustWork"
:apiCreate="CountadjustWorkApi.createCountadjustWork"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="CountadjustWork.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/plan/countadjust-plan/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CountadjustWork,CountadjustWorkRules } from './countadjustWork.data'
import * as CountadjustWorkApi from '@/api/eam/item/countadjustWork'
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: 'CountadjustWork' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(CountadjustWork.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: CountadjustWorkApi.getCountadjustWorkPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:countadjustWork:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:countadjustWork:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:countadjustWork: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:countadjustWork:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:countadjustWork: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 =CountadjustWork.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 CountadjustWorkApi.createCountadjustWork(data)
message.success(t('common.createSuccess'))
} else {
await CountadjustWorkApi.updateCountadjustWork(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, 'basicCountadjustWork')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await CountadjustWorkApi.deleteCountadjustWork(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 CountadjustWorkApi.exportCountadjustWork(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 CountadjustWorkApi.importTemplate()
})
</script>

2
src/views/eam/item/itemApplyMain/index.vue

@ -148,7 +148,7 @@
// //
const isShowMainButton = (row, val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.available) > -1) { if (val.indexOf(row.status) > -1) {
return false return false
} else { } else {
return true return true

2
src/views/eam/item/itemOrderMain/index.vue

@ -156,7 +156,7 @@
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListOrderCloBtn({ hide: isShowMainButton(row, ['TRUE']) }), // defaultButtons.mainListOrderCloBtn({ hide: isShowMainButton(row, ['OPEN']) }), //
defaultButtons.mainListEditBtn(null), // defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), // defaultButtons.mainListDeleteBtn(null), //
] ]

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

@ -41,11 +41,6 @@ export const ItemOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
isForm: false, isForm: false,
isSearch: false, isSearch: false,
}, },
{
label: '描述',
field: 'name',
sort: 'custom',
},
{ {
label: '接收备件状态', label: '接收备件状态',
field: 'status', field: 'status',
@ -84,14 +79,8 @@ export const ItemOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验 //表单校验
export const ItemOrderMainRules = reactive({ export const ItemOrderMainRules = reactive({
name: [
{ required: true, message: '请填写描述', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [ available: [
{ required: true, message: '请选择是否可用', trigger: 'change' } { required: true, message: '请选择是否关闭', trigger: 'change' }
], ],
}) })

Loading…
Cancel
Save