ljlong_2630 7 months ago
parent
commit
3850ae7f51
  1. 320
      src/views/eam/basic/item/index.vue
  2. 33
      src/views/eam/basic/item/item.data.ts
  3. 311
      src/views/eam/item/itemAccounts/index.vue

320
src/views/eam/basic/item/index.vue

@ -1,130 +1,187 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Item.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="Item.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :allSchemas="Item.allSchemas" />
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Item.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
<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}">
}"
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)" />
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event, row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="ItemRules" :formAllSchemas="Item.allSchemas"
:apiUpdate="ItemApi.updateItem" :apiCreate="ItemApi.createItem" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" />
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="ItemRules"
:formAllSchemas="Item.allSchemas"
:apiUpdate="ItemApi.updateItem"
:apiCreate="ItemApi.createItem"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<SearchTable ref="searchTableRef" @searchTableSuccess="submitItem" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Item.allSchemas" />
<Dialog
ref="basicFormViewRef"
v-model="showView"
:key="viewKey"
:closeOnClickModal="true"
:title="viewTitle"
>
<el-image v-for="url in urls" :key="url" :src="url" lazy />
</Dialog>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Item, ItemRules } from './item.data'
import * as ItemApi from '@/api/eam/basic/item'
import { createDeviceItemBatch, getDeviceItemPage, getDeviceItemNoPage } from '@/api/eam/basic/rel'
import { DeviceAccounts, DeviceAccountsRules } from '@/views/eam/device/deviceAccounts/deviceAccounts.data'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
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'
import { SearchTable } from '@/components/SearchTable'
defineOptions({ name: 'Item' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const itemNumber = ref();
const tableColumns = ref(Item.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
import download from '@/utils/download'
import { Item, ItemRules } from './item.data'
import * as ItemApi from '@/api/eam/basic/item'
import { createDeviceItemBatch, getDeviceItemPage, getDeviceItemNoPage } from '@/api/eam/basic/rel'
import {
DeviceAccounts,
DeviceAccountsRules
} from '@/views/eam/device/deviceAccounts/deviceAccounts.data'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
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'
import { SearchTable } from '@/components/SearchTable'
defineOptions({ name: 'Item' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const itemNumber = ref()
const tableColumns = ref(Item.allSchemas.tableColumns)
const showView = ref(false)
const viewTitle = ref('图片预览')
const urls = ref([])
const viewKey = ref(0)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
}
//
const updataTableColumns = (val) => {
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
}
const { tableObject, tableMethods } = useTable({
const { tableObject, tableMethods } = useTable({
getListApi: ItemApi.getItemPage //
})
})
//
const { getList, setSearchParams } = tableMethods
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'basic:item:create'}), //
defaultButtons.defaultExportBtn({hasPermi:'basic:item:export'}), //
//
const HeadButttondata =[
defaultButtons.defaultAddBtn({ hasPermi: 'basic:item:create' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'basic:item:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
defaultButtons.defaultSetBtn(null) //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
//
const buttonBaseClick = (val, item) => {
if (val == 'add') {
//
openForm('create')
} else if (val == 'export') { //
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'basic:item:update'}), //
defaultButtons.chooseDeviceBtn({hasPermi:'basic:item:choose'}),//
defaultButtons.mainListDeleteBtn({hasPermi:'basic:item:delete'}), //
]
// -
const butttondataView = (row) => {
return [defaultButtons.viewBtn(null)]
}
// -
const butttondata =(row)=>{
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
return [
defaultButtons.mainListEditBtn({ hasPermi: 'basic:item:update' }), //
defaultButtons.chooseDeviceBtn({ hasPermi: 'basic:item:choose' }), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'basic:item:delete' }), //
defaultButtons.viewBtn({hide: !(row.filePathList != null && row.filePathList.length != 0 )})
]}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'chooseDevice') {
openItem(row.number)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
} else if (val == 'view') {
//
openForm('view', row)
}
}
}
const searchTableRef = ref()
/** 绑定备件操作 */
const openItem = async (number : String) => {
const searchTableRef = ref()
/** 绑定备件操作 */
const openItem = async (number: String) => {
itemNumber.value = number
await CallBack1()
searchTableRef.value.open(
@ -140,54 +197,73 @@
null,
searchTableSelections.value
)
}
}
const searchTableSelections = ref([])
const CallBack1 = async () => {
const searchTableSelections = ref([])
const CallBack1 = async () => {
await getDeviceItemNoPage({ itemNumber: itemNumber.value }).then(async (res) => {
await DeviceAccountsApi.getDeviceAccountsAllNoPage({}).then(response => {
searchTableSelections.value = response.filter(element => {
let flag = false;
res.forEach(item => {
await DeviceAccountsApi.getDeviceAccountsAllNoPage({}).then((response) => {
searchTableSelections.value = response.filter((element) => {
let flag = false
res.forEach((item) => {
if (element.number == item.deviceNumber) {
flag = true;
flag = true
}
});
return flag;
});
});
});
};
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
const deviceItemRelList = selections.map(element => ({
})
return flag
})
})
})
}
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
const deviceItemRelList = selections.map((element) => ({
itemNumber: itemNumber.value,
deviceNumber: element.number,
}));
createDeviceItemBatch(deviceItemRelList).then(res => {
deviceNumber: element.number
}))
createDeviceItemBatch(deviceItemRelList).then((res) => {
message.success(t('common.createSuccess'))
})
};
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type : string, row ?: any) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
console.log(row)
if (type == 'view') {
showView.value = true
urls.value = row.filePathList
viewKey.value += 1
} else {
if (row && row.filePathList && row.filePathList.length > 0) {
row.filePathListView = row.filePathList.map((item) => {
return {
name: item,
url: item
}
})
}
basicFormRef.value.open(type, row)
}
}
// form
const formsSuccess = async (formType, data) => {
// form
const formsSuccess = async (formType, data) => {
var isHave = Item.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
return item.field === 'activeTime' || item.field === 'expireTime'
})
if (isHave) {
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间')
return;
return
}
}
if (data.activeTime == 0) data.activeTime = null;
if (data.expireTime == 0) data.expireTime = null;
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
data.filePathList = []
for (let i = 0; i < data.filePathListView.length; i++) {
data.filePathList.push(data.filePathListView[i].url)
}
if (formType === 'create') {
await ItemApi.createItem(data)
message.success(t('common.createSuccess'))
@ -197,16 +273,16 @@
}
basicFormRef.value.dialogVisible = false
getList()
}
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicItem')
}
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
@ -215,12 +291,12 @@
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
}
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
@ -232,19 +308,19 @@
} finally {
exportLoading.value = false
}
}
}
//
const searchFormClick = (searchData) => {
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
}
/** 初始化 **/
onMounted(async () => {
/** 初始化 **/
onMounted(async () => {
getList()
})
})
</script>

33
src/views/eam/basic/item/item.data.ts

@ -274,6 +274,39 @@ export const Item = useCrudSchemas(reactive<CrudSchema[]>([
field: 'describes',
sort: 'custom',
},
{
label: '图片',
field: 'upload',
isTable: true,
},
{
label: '文件',
field: 'filePathListView',
sort: 'custom',
isTable: false,
table: {
},
form: {
component: 'UploadFile',
componentProps: {
}
}
},
{
label: '文件',
field: 'filePathList',
sort: 'custom',
isTable: false,
isForm: false,
table: {
},
form: {
component: 'UploadFile',
componentProps: {
}
}
},
{
label: '操作',
field: 'action',

311
src/views/eam/item/itemAccounts/index.vue

@ -1,34 +1,65 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ItemAccounts.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="ItemAccounts.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :allSchemas="ItemAccounts.allSchemas" />
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ItemAccounts.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
<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}">
}"
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)" />
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event, row)" />
</template>
<!-- <template #upload="{ row }">
<ButtonBase
v-if="row.filePathList != null && row.filePathList.length != 0"
:Butttondata="butttondataView(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> -->
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="ItemAccountsRules"
:formAllSchemas="ItemAccounts.allSchemas" :apiUpdate="ItemAccountsApi.updateItemAccounts"
:apiCreate="ItemAccountsApi.createItemAccounts" @searchTableSuccess="searchTableSuccess" :isBusiness="false" />
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="ItemAccountsRules"
:formAllSchemas="ItemAccounts.allSchemas"
:apiUpdate="ItemAccountsApi.updateItemAccounts"
:apiCreate="ItemAccountsApi.createItemAccounts"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<SearchTable ref="searchTableRef" @searchTableSuccess="submitItem" />
@ -36,61 +67,80 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="ItemAccounts.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/item-accounts/import" :importTemplateData="importTemplateData"
@success="importSuccess" />
<ImportForm
ref="importFormRef"
url="/eam/item-accounts/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
<Dialog
ref="basicFormViewRef"
v-model="showView"
:key="viewKey"
:closeOnClickModal="true"
:title="viewTitle"
>
<el-image v-for="url in urls" :key="url" :src="url" lazy />
</Dialog>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ItemAccounts, ItemAccountsRules } from './itemAccounts.data'
import * as ItemAccountsApi from '@/api/eam/item/itemAccounts'
import { Item } from '@/views/eam/basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
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: 'ItemAccounts' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
const locationNumber = ref()
const wantId1 = ref()
routeName.value = route.name
const tableColumns = ref(ItemAccounts.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
import download from '@/utils/download'
import { ItemAccounts, ItemAccountsRules } from './itemAccounts.data'
import * as ItemAccountsApi from '@/api/eam/item/itemAccounts'
import { Item } from '@/views/eam/basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
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: 'ItemAccounts' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
const locationNumber = ref()
const wantId1 = ref()
routeName.value = route.name
const tableColumns = ref(ItemAccounts.allSchemas.tableColumns)
const showView = ref(false)
const viewTitle = ref('图片预览')
const urls = ref([])
const viewKey = ref(0)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
}
//
const updataTableColumns = (val) => {
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
}
const { tableObject, tableMethods } = useTable({
const { tableObject, tableMethods } = useTable({
getListApi: ItemAccountsApi.getItemAccountsPage //
})
})
//
const { getList, setSearchParams } = tableMethods
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'item:itemAccounts:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'item:itemAccounts:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'item:itemAccounts:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -99,45 +149,73 @@
// icon: 'Select',
// color: ''
// },
]
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
//
const buttonBaseClick = (val, item) => {
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') { //
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') { //
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
}
// -
// const butttondata = [
// defaultButtons.mainListEditBtn({ hasPermi: 'item:itemAccounts:update' }), //
// defaultButtons.replaceLocation({ hasPermi: 'item:itemAccounts:replaceLocation' }), //
// defaultButtons.mainListDeleteBtn({ hasPermi: 'item:itemAccounts:delete' }) //
// ]
// -
const butttondata = [
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hasPermi: 'item:itemAccounts:update' }), //
defaultButtons.replaceLocation({ hasPermi: 'item:itemAccounts:replaceLocation' }), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'item:itemAccounts:delete' }), //
defaultButtons.viewBtn({hide: !(row.filePathList != null && row.filePathList.length != 0 )})
//defaultButtons.backoutBtn({hasPermi:'eam:device-repair-request:cancel', hide: !(row.result == 'PENDING' && row.declarer == userStore.getUser.id )}), //
]
}
// -
const butttondataView = (row) => {
return [defaultButtons.viewBtn(null)]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
} else if (val == 'replaceLocation') {
openItem(row.locationNumber, row.id)
} else if (val == 'view') {
//
openForm('view', row)
}
}
}
const searchTableRef = ref()
/** 绑定备件操作 */
const openItem = async (number : String, wantId : number) => {
const searchTableRef = ref()
/** 绑定备件操作 */
const openItem = async (number: String, wantId: number) => {
locationNumber.value = number
wantId1.value = wantId
searchTableRef.value.open(
@ -152,26 +230,25 @@
null,
null
)
}
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
}
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
const deviceItemRelList = selections.map((element) => ({
id: wantId1.value,
locationNumber: locationNumber.value,
itemNumber: element.number,
itemNumber: element.number
}))
ItemAccountsApi.replaceLocation(deviceItemRelList).then((res) => {
message.success(t('更换成功'))
//
getList()
})
}
}
const getItemWithOutBind = async () => {
const getItemWithOutBind = async () => {
try {
const res = await ItemApi.getItemPage({
...Item.allSchemas.searchSchema,
available: "TRUE"
available: 'TRUE'
})
if (res.list?.length > 0) {
// const response = await getDeviceItemPage(DeviceAccounts.allSchemas.searchSchema);
@ -189,27 +266,33 @@
console.error(error)
throw error //
}
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type : string, row ?: any) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if (type == 'view') {
showView.value = true
urls.value = row.filePathList
viewKey.value += 1
} else {
basicFormRef.value.open(type, row)
}
}
// form
const formsSuccess = async (formType, data) => {
// form
const formsSuccess = async (formType, data) => {
var isHave = ItemAccounts.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
return item.field === 'activeTime' || item.field === 'expireTime'
})
if (isHave) {
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间')
return;
return
}
}
if (data.activeTime == 0) data.activeTime = null;
if (data.expireTime == 0) data.expireTime = null;
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') {
await ItemAccountsApi.createItemAccounts(data)
message.success(t('common.createSuccess'))
@ -219,16 +302,16 @@
}
basicFormRef.value.dialogVisible = false
getList()
}
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => {
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicItemAccounts')
}
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
@ -237,12 +320,12 @@
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
}
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
@ -254,35 +337,35 @@
} finally {
exportLoading.value = false
}
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '备件台账导入模版.xlsx'
})
//
const importSuccess = () => {
})
//
const importSuccess = () => {
getList()
}
}
//
const searchFormClick = (searchData) => {
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
}
/** 初始化 **/
onMounted(async () => {
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ItemAccountsApi.importTemplate()
})
})
</script>

Loading…
Cancel
Save