|
@ -58,14 +58,15 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
|
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
|
|
|
import { getStrDictOptions } from '@/utils/dict' |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { FixedAssets,FixedAssetsRules } from './fixedAssets.data' |
|
|
import { FixedAssets,FixedAssetsRules } from './fixedAssets.data' |
|
|
import * as FixedAssetsApi from '@/api/eam/basic/fixedAssets' |
|
|
import * as FixedAssetsApi from '@/api/eam/basic/fixedAssets' |
|
|
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' |
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
// import Detail from '@/components/Detail/src/Detail.vue' |
|
|
|
|
|
|
|
|
defineOptions({ name: 'FixedAssets' }) |
|
|
defineOptions({ name: 'FixedAssets' }) |
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
const message = useMessage() // 消息弹窗 |
|
@ -149,6 +150,9 @@ const buttonTableClick = async (val, row) => { |
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const basicFormRef = ref() |
|
|
const basicFormRef = ref() |
|
|
const openForm = (type: string, row?: any) => { |
|
|
const openForm = (type: string, row?: any) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
basicFormRef.value.open(type, row) |
|
|
basicFormRef.value.open(type, row) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -165,10 +169,19 @@ const formsSuccess = async (formType,data) => { |
|
|
} |
|
|
} |
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
|
|
|
const userStore = useUserStore() // 用户信息 |
|
|
|
|
|
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.SPECIAL_DEPT_ROLE) |
|
|
|
|
|
// 查找第一个同时存在于userStore.roles和deviceMoldTypeList中的值 |
|
|
|
|
|
const matchingRole = userStore.roles.find(role => |
|
|
|
|
|
deviceMoldTypeList.some(deviceMold => deviceMold.value === role) |
|
|
|
|
|
); |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|
|
|
|
data.manageDept = matchingRole |
|
|
await FixedAssetsApi.createFixedAssets(data) |
|
|
await FixedAssetsApi.createFixedAssets(data) |
|
|
|
|
|
|
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
data.manageDept = matchingRole |
|
|
await FixedAssetsApi.updateFixedAssets(data) |
|
|
await FixedAssetsApi.updateFixedAssets(data) |
|
|
message.success(t('common.updateSuccess')) |
|
|
message.success(t('common.updateSuccess')) |
|
|
} |
|
|
} |
|
|