You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
549 lines
19 KiB
549 lines
19 KiB
<template>
|
|
<ContentWrap>
|
|
<!-- 搜索工作栏 -->
|
|
<Search :schema="EquipmentAccounts.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
|
|
</ContentWrap>
|
|
|
|
<!-- 列表头部 -->
|
|
<TableHead
|
|
:HeadButttondata="HeadButttondata"
|
|
@button-base-click="buttonBaseClick"
|
|
:routeName="routeName"
|
|
@updataTableColumns="updataTableColumns"
|
|
@searchFormClick="searchFormClick"
|
|
:allSchemas="EquipmentAccounts.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(row)" @button-base-click="buttonTableClick($event,row)"/>
|
|
</template>
|
|
</Table>
|
|
</ContentWrap>
|
|
|
|
<!-- 表单弹窗:添加/修改 -->
|
|
<BasicForm
|
|
ref="basicFormRef"
|
|
@success="formsSuccess"
|
|
:rules="EquipmentAccountsRules"
|
|
:formAllSchemas="EquipmentAccounts.allSchemas"
|
|
:apiUpdate="EquipmentAccountsApi.updateEquipmentAccounts"
|
|
:apiCreate="EquipmentAccountsApi.createEquipmentAccounts"
|
|
@searchTableSuccess="searchTableSuccess"
|
|
@onChange="onChange"
|
|
:isBusiness="false"
|
|
/>
|
|
|
|
<AblesForm ref="ablesFormRef" @success="getData" @close="getClosed"/>
|
|
|
|
<!-- 详情 -->
|
|
<DetailLedger
|
|
ref="detailRef"
|
|
:isBasic="true"
|
|
:allSchemas="EquipmentAccounts.allSchemas"
|
|
:subTabs="subTabList"
|
|
:operationRecordList="operationRecordList"
|
|
@handleOperationTabsChange="handleOperationTabsChange"
|
|
:detailAllSchemas="detailAllSchemas"
|
|
:apiPage="apiPage"
|
|
:dialogApiPage="dialogApiPage"
|
|
:dialogAllSchemas="dialogAllSchemas"
|
|
:dynamicInfoFields="dynamicInfoFields"
|
|
funcCode="device_mould_file"
|
|
/>
|
|
<!-- 主要部件 -->
|
|
<SearchTable ref="searchTableRef" @searchTableSuccess="submitEquipmentMainPartRelation" />
|
|
<!-- 备件 -->
|
|
<SearchTable ref="searchSparePartTableRef" @searchTableSuccess="submitSparePartRelation" />
|
|
<!-- 导入 -->
|
|
<ImportForm ref="importFormRef" url="/eam/device/equipment-accounts/import" :importTemplateData="importTemplateData" @success="importSuccess" />
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import download from '@/utils/download'
|
|
import { EquipmentAccounts,EquipmentAccountsRules } from './equipmentAccounts.data'
|
|
import * as EquipmentAccountsApi from '@/api/eam/equipmentAccounts'
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons'
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue'
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
|
|
import AblesForm from '@/views/eam/equipmentAccounts/ablesForm.vue'
|
|
import DetailLedger from '@/components/Detail/src/DetailLedger.vue'
|
|
import * as RelationMainPartApi from '@/api/eam/relationMainPart'
|
|
import { EquipmentMainPart,EquipmentMainPartRules } from '../equipmentMainPart/equipmentMainPart.data'
|
|
import * as EquipmentMainPartApi from '@/api/eam/equipmentMainPart'
|
|
import { SparePart,SparePartRules } from '../sparePart/sparePart.data'
|
|
import * as SparePartApi from '@/api/eam/sparePart'
|
|
import * as EquipmentToolSparePartApi from '@/api/eam/equipmentToolSparePart'
|
|
import { EquipmentReportRepairRequest,EquipmentReportRepairRequestRules } from '../equipmentReportRepairRequest/equipmentReportRepairRequest.data'
|
|
import * as EquipmentReportRepairRequestApi from '@/api/eam/equipmentReportRepairRequest'
|
|
import { EquipmentSpotCheckRecordMain,EquipmentSpotCheckRecordMainRules } from '../equipmentSpotCheckRecordMain/equipmentSpotCheckRecordMain.data'
|
|
import * as EquipmentSpotCheckRecordMainApi from '@/api/eam/equipmentSpotCheckRecordMain'
|
|
import { EquipmentSpotCheckRecordDetail,EquipmentSpotCheckRecordDetailRules } from '../equipmentSpotCheckRecordDetail/equipmentSpotCheckRecordDetail.data'
|
|
import * as EquipmentSpotCheckRecordDetailApi from '@/api/eam/equipmentSpotCheckRecordDetail'
|
|
import { EquipmentInspectionRecordMain,EquipmentInspectionRecordMainRules } from '../equipmentInspectionRecordMain/equipmentInspectionRecordMain.data'
|
|
import * as EquipmentInspectionRecordMainApi from '@/api/eam/equipmentInspectionRecordMain'
|
|
import { EquipmentInspectionRecordDetail,EquipmentInspectionRecordDetailRules } from '../equipmentInspectionRecordDetail/equipmentInspectionRecordDetail.data'
|
|
import * as EquipmentInspectionRecordDetailApi from '@/api/eam/equipmentInspectionRecordDetail'
|
|
import { EquipmentRepairRecordMain,EquipmentRepairRecordMainRules } from '../equipmentRepairRecordMain/equipmentRepairRecordMain.data'
|
|
import * as EquipmentRepairRecordMainApi from '@/api/eam/equipmentRepairRecordMain'
|
|
import { EquipmentRepairRecordDetail,EquipmentRepairRecordDetailRules } from '../equipmentRepairRecordDetail/equipmentRepairRecordDetail.data'
|
|
import * as EquipmentRepairRecordDetailApi from '@/api/eam/equipmentRepairRecordDetail'
|
|
import { EquipmentMaintenanceRecordMain,EquipmentMaintenanceRecordMainRules } from '../equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data'
|
|
import * as EquipmentMaintenanceRecordMainApi from '@/api/eam/equipmentMaintenanceRecordMain'
|
|
import { EquipmentMaintenanceRecordDetail,EquipmentMaintenanceRecordDetailRules } from '../equipmentMaintenanceRecordDetail/equipmentMaintenanceRecordDetail.data'
|
|
import * as EquipmentMaintenanceRecordDetailApi from '@/api/eam/equipmentMaintenanceRecordDetail'
|
|
import * as WorkshopApi from '@/api/wms/workshop'
|
|
import * as ProductionlineApi from '@/api/wms/productionline'
|
|
import * as EquipmentSupplierApi from '@/api/eam/equipmentSupplier'
|
|
import * as EquipmentManufacturerApi from '@/api/eam/equipmentManufacturer'
|
|
import * as UserApi from '@/api/system/user'
|
|
import { usePageLoading } from '@/hooks/web/usePageLoading'
|
|
const { loadStart, loadDone } = usePageLoading()
|
|
|
|
defineOptions({ name: 'EquipmentAccounts' })
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
const { t } = useI18n() // 国际化
|
|
|
|
const route = useRoute() // 路由信息
|
|
const routeName = ref()
|
|
const deviceNumber = ref()
|
|
routeName.value = route.name
|
|
const tableColumns = ref(EquipmentAccounts.allSchemas.tableColumns)
|
|
const tabs = ref<{ label: string; prop: string; }[]>([])
|
|
const subTabList = ref([]);
|
|
const detailAllSchemas = ref()
|
|
const apiPage = ref()
|
|
const dialogApiPage = ref()
|
|
const dialogAllSchemas = ref()
|
|
export interface User {
|
|
id: number,
|
|
nickname: string
|
|
}
|
|
// 查询页面返回
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => {
|
|
nextTick(() => {
|
|
const setV = {}
|
|
setV[formField] = val[0][searchField]
|
|
if(formField == 'workshopName'){
|
|
setV['workshopCode'] = val[0]['code']
|
|
setV['workshopName'] = val[0]['name']
|
|
}else if(formField == 'lineName'){
|
|
setV['lineCode'] = val[0]['code']
|
|
setV['lineName'] = val[0]['name']
|
|
}else if(formField == 'manufactureName'){
|
|
setV['manufactureCode'] = val[0]['number']
|
|
setV['manufactureName'] = val[0]['name']
|
|
}else if(formField == 'supplierName'){
|
|
setV['supplierCode'] = val[0]['number']
|
|
setV['supplierName'] = val[0]['name']
|
|
}
|
|
formRef.setValues(setV)
|
|
})
|
|
}
|
|
|
|
const operationRecordList = ref([
|
|
{label:'报修记录',value:'report'},
|
|
{label:'维修记录',value:'repair'},
|
|
{label:'保养记录',value:'maintenance'},
|
|
{label:'巡检记录',value:'inspection'},
|
|
{label:'点检记录',value:'spot_check'},
|
|
|
|
])
|
|
|
|
|
|
const dynamicInfoFields = ref([
|
|
"totalRunningTime",
|
|
"maintenanceRunningTime",
|
|
"usageTimes",
|
|
"lastInspectionDate",
|
|
"outageRate",
|
|
"breakdownRecover",
|
|
"purchaseInterval"
|
|
]);
|
|
|
|
// 字段设置 更新主列表字段
|
|
const updataTableColumns = (val) => {
|
|
tableColumns.value = val
|
|
}
|
|
|
|
const { tableObject, tableMethods } = useTable({
|
|
getListApi: EquipmentAccountsApi.getEquipmentAccountsPage // 分页接口
|
|
})
|
|
|
|
// 获得表格的各种操作
|
|
const { getList, setSearchParams } = tableMethods
|
|
|
|
// 列表头部按钮
|
|
const HeadButttondata = [
|
|
defaultButtons.defaultAddBtn({hasPermi:'eam:equipment-accounts:create'}), // 新增
|
|
defaultButtons.defaultImportBtn({hasPermi:'eam:equipment-accounts:import'}), // 导入
|
|
defaultButtons.defaultExportBtn({hasPermi:'eam:equipment-accounts: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 isShowMainButton = (row,val) => {
|
|
if (val.indexOf(row.available) > -1) {
|
|
return false
|
|
} else {
|
|
return true
|
|
}
|
|
}
|
|
|
|
// 列表-操作按钮
|
|
const butttondata = (row) => {
|
|
return [
|
|
defaultButtons.mainListEditBtn({hasPermi:'eam:equipment-accounts:update'}), // 编辑
|
|
defaultButtons.componentBtn({hasPermi:'eam:equipment-accounts:component'}), // 部件
|
|
defaultButtons.sparePartBtn({hasPermi:'eam:equipment-accounts:item'}), // 备件
|
|
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:basicFaultType:update'}),
|
|
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:basicFaultType:update'}),
|
|
]
|
|
}
|
|
|
|
//启用禁用
|
|
const ablesFormRef = ref()
|
|
function openables(row, val) {
|
|
ablesFormRef.value.open(val,row);
|
|
}
|
|
|
|
// 列表-操作按钮事件
|
|
const buttonTableClick = async (val, row) => {
|
|
if (val == 'edit') { // 编辑
|
|
openForm('update', row)
|
|
} else if (val == 'delete') { // 删除
|
|
handleDelete(row.id)
|
|
} else if (val == 'component') { // 部件
|
|
openComponent(row)
|
|
} else if (val == 'sparePart') { // 备件
|
|
openSparePart(row)
|
|
} else if (val == 'enable') { // 启用/禁用
|
|
openables(row,val)
|
|
} else if (val == 'disable') { // 启用/禁用
|
|
openables(row,val)
|
|
}
|
|
}
|
|
|
|
/** 添加/修改操作 */
|
|
const basicFormRef = ref()
|
|
const openForm = async (type: string, row?: any) => {
|
|
if(type == 'update'){
|
|
const equipmentManufacturerNoPage = await EquipmentManufacturerApi.getEquipmentManufacturerNoPage({})
|
|
const equipmentSupplierNoPage = await EquipmentSupplierApi.getEquipmentSupplierNoPage({})
|
|
const workshopNoPage = await WorkshopApi.getWorkshopNoPage({})
|
|
const productionlineNoPage = await ProductionlineApi.getProductionlineNoPage({});
|
|
row.workshopName = workshopNoPage?.find(item=>item.code == row.workshopCode)?.name
|
|
row.lineName = productionlineNoPage?.find(item=>item.code == row.lineCode)?.name
|
|
row.manufactureName = equipmentManufacturerNoPage?.find(item=>item.number == row.manufactureCode)?.name
|
|
row.supplierName = equipmentSupplierNoPage?.find(item=>item.number == row.supplierCode)?.name
|
|
|
|
EquipmentAccounts.allSchemas.formSchema.forEach((item) => {
|
|
if (item.field == 'status') {
|
|
item.componentProps.disabled = false
|
|
|
|
}
|
|
})
|
|
}else{
|
|
EquipmentAccounts.allSchemas.formSchema.forEach((item) => {
|
|
if (item.field == 'status') {
|
|
item.componentProps.disabled = true
|
|
item.value = 'TOACCEPT'
|
|
}
|
|
})
|
|
}
|
|
basicFormRef.value.open(type, row)
|
|
}
|
|
|
|
// form表单提交
|
|
const formsSuccess = async (formType,data) => {
|
|
var isHave =EquipmentAccounts.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 EquipmentAccountsApi.createEquipmentAccounts(data)
|
|
message.success(t('common.createSuccess'))
|
|
} else {
|
|
await EquipmentAccountsApi.updateEquipmentAccounts(data)
|
|
message.success(t('common.updateSuccess'))
|
|
}
|
|
basicFormRef.value.dialogVisible = false
|
|
getList()
|
|
}
|
|
|
|
/** 详情操作 */
|
|
const detailRef = ref()
|
|
const openDetail = async (row: any, titleName: any, titleValue: any) => {
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentAccounts')
|
|
}
|
|
|
|
/** 删除按钮操作 */
|
|
const handleDelete = async (id: number) => {
|
|
try {
|
|
// 删除的二次确认
|
|
await message.delConfirm()
|
|
// 发起删除
|
|
await EquipmentAccountsApi.deleteEquipmentAccounts(id)
|
|
message.success(t('common.delSuccess'))
|
|
// 刷新列表
|
|
await getList()
|
|
} catch {}
|
|
}
|
|
|
|
/** 导出按钮操作 */
|
|
const handleExport = async () => {
|
|
try {
|
|
// 导出的二次确认
|
|
await message.exportConfirm()
|
|
// 发起导出
|
|
loadStart()
|
|
const data = await EquipmentAccountsApi.exportEquipmentAccounts(tableObject.params)
|
|
download.excel(data, '设备台账.xlsx')
|
|
} catch {
|
|
} finally {
|
|
loadDone()
|
|
}
|
|
}
|
|
|
|
/** 导入 */
|
|
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() // 刷新当前列表
|
|
}
|
|
|
|
//ablesForm 提交按钮回传
|
|
const getData=(val)=> {
|
|
nextTick?.(async () => {
|
|
await getList()
|
|
})
|
|
}
|
|
|
|
//ablesForm 关闭按钮回传
|
|
const getClosed=(val)=> {
|
|
nextTick?.(() => {
|
|
console.log(val)
|
|
getList()
|
|
})
|
|
}
|
|
|
|
|
|
const searchTableRef = ref()
|
|
const searchSparePartTableRef = ref()
|
|
const searchTableSelections = ref([])
|
|
const searchTableSparePartSelections = ref([])
|
|
const syncData = async (row) => {
|
|
searchTableSparePartSelections.value = []
|
|
await RelationMainPartApi.getRelationMainPartNoPage({ equipmentCode: row.code,type: 'DEVICE' }).then(async (res) => {
|
|
await EquipmentMainPartApi.getEquipmentMainPartNoPage({type: 'DEVICE' }).then(response => {
|
|
searchTableSelections.value = response.filter(element => {
|
|
let flag = false;
|
|
res.forEach(item => {
|
|
if (element.code == item.mainPartCode) {
|
|
flag = true;
|
|
}
|
|
});
|
|
return flag;
|
|
});
|
|
});
|
|
});
|
|
};
|
|
const syncSparePartData = async (row) => {
|
|
searchTableSparePartSelections.value = []
|
|
await EquipmentToolSparePartApi.getEquipmentToolSparePartNoPage({ equipmentToolCode: row.code}).then(async (res) => {
|
|
await SparePartApi.getSparePartNoPage({}).then(response => {
|
|
searchTableSparePartSelections.value = response.filter(element => {
|
|
let flag = false;
|
|
res.forEach(item => {
|
|
if (element.code == item.sparePartCode) {
|
|
flag = true;
|
|
}
|
|
});
|
|
return flag;
|
|
});
|
|
});
|
|
});
|
|
};
|
|
/** 绑定备件操作 */
|
|
const openComponent = async (row : any) => {
|
|
await syncData(row)
|
|
searchTableRef.value.open(
|
|
'选择部件',
|
|
EquipmentMainPart.allSchemas,
|
|
EquipmentMainPartApi.getEquipmentMainPartPage,
|
|
'equipmentMainPart',
|
|
EquipmentMainPart.allSchemas.searchSchema,
|
|
true,
|
|
null,//type
|
|
row,
|
|
{type: 'DEVICE'},
|
|
null,
|
|
null,
|
|
null,
|
|
searchTableSelections.value
|
|
)
|
|
}
|
|
|
|
const openSparePart = async (row : any) => {
|
|
await syncSparePartData(row)
|
|
searchSparePartTableRef.value.open(
|
|
'选择备件',
|
|
SparePart.allSchemas,
|
|
SparePartApi.getSparePartPage,
|
|
'sparePartPart',
|
|
SparePart.allSchemas.searchSchema,
|
|
true,
|
|
null,//type
|
|
row,
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
searchTableSparePartSelections.value
|
|
)
|
|
}
|
|
|
|
const submitEquipmentMainPartRelation = (formField, searchField, val, formRef, rowRef) => {
|
|
const deviceMainPartRelList = val.map((element) => ({
|
|
mainPartCode: element.code,
|
|
equipmentCode: rowRef.code,
|
|
type: 'DEVICE'
|
|
}))
|
|
RelationMainPartApi.createRelationMainPartBatch(deviceMainPartRelList).then(res => {
|
|
message.success(t('common.createSuccess'))
|
|
getList()
|
|
})
|
|
}
|
|
const handleOperationTabsChange = (val) => {
|
|
if(val == 'report'){
|
|
apiPage.value = EquipmentReportRepairRequestApi.getEquipmentReportRepairRequestPage
|
|
detailAllSchemas.value = EquipmentReportRepairRequest.allSchemas
|
|
}else if(val == 'repair'){
|
|
apiPage.value = EquipmentRepairRecordMainApi.getEquipmentRepairRecordMainPage
|
|
detailAllSchemas.value = EquipmentRepairRecordMain.allSchemas
|
|
dialogApiPage.value = EquipmentRepairRecordDetailApi.getEquipmentRepairRecordDetailPage
|
|
dialogAllSchemas.value = EquipmentRepairRecordDetail.allSchemas
|
|
}else if(val == 'maintenance'){
|
|
apiPage.value = EquipmentMaintenanceRecordMainApi.getEquipmentMaintenanceRecordMainPage
|
|
detailAllSchemas.value = EquipmentMaintenanceRecordMain.allSchemas
|
|
dialogApiPage.value = EquipmentMaintenanceRecordDetailApi.getEquipmentMaintenanceRecordDetailPage
|
|
dialogAllSchemas.value = EquipmentMaintenanceRecordDetail.allSchemas
|
|
}else if(val == 'inspection'){
|
|
apiPage.value = EquipmentInspectionRecordMainApi.getEquipmentInspectionRecordMainPage
|
|
detailAllSchemas.value = EquipmentInspectionRecordMain.allSchemas
|
|
dialogApiPage.value = EquipmentInspectionRecordDetailApi.getEquipmentInspectionRecordDetailPage
|
|
dialogAllSchemas.value = EquipmentInspectionRecordDetail.allSchemas
|
|
}else if(val == 'spot_check'){
|
|
apiPage.value = EquipmentSpotCheckRecordMainApi.getEquipmentSpotCheckRecordMainPage
|
|
detailAllSchemas.value = EquipmentSpotCheckRecordMain.allSchemas
|
|
dialogApiPage.value = EquipmentSpotCheckRecordDetailApi.getEquipmentSpotCheckRecordDetailPage
|
|
dialogAllSchemas.value = EquipmentSpotCheckRecordDetail.allSchemas
|
|
}
|
|
}
|
|
|
|
const submitSparePartRelation = (formField, searchField, val, formRef, rowRef) => {
|
|
const equipmentToolSparePartRelList = val.map((element) => ({
|
|
sparePartCode: element.code,
|
|
equipmentToolCode: rowRef.code,
|
|
type: 'DEVICE'
|
|
}))
|
|
EquipmentToolSparePartApi.createEquipmentToolSparePartBatch(equipmentToolSparePartRelList).then(res => {
|
|
message.success(t('common.createSuccess'))
|
|
getList()
|
|
})
|
|
}
|
|
|
|
const onChange = async (field, cur, formRef) => {
|
|
if(field == 'purchaseDept'){
|
|
const userList = ref<User[]>([])
|
|
userList.value = await UserApi.getUserListByDeptIds([cur])
|
|
EquipmentAccounts.allSchemas.formSchema.find(item => item.field == 'purchaser').componentProps.options = userList.value
|
|
let setV = {}
|
|
setV['purchaser'] = ''
|
|
formRef.value.setValues(setV)
|
|
}
|
|
if(field == 'useDept'){
|
|
const user01List = ref<User[]>([])
|
|
user01List.value = await UserApi.getUserListByDeptIds([cur])
|
|
EquipmentAccounts.allSchemas.formSchema.find(item => item.field == 'principal').componentProps.options = user01List.value
|
|
let setV = {}
|
|
setV['principal'] = ''
|
|
formRef.value.setValues(setV)
|
|
}
|
|
|
|
}
|
|
|
|
/** 初始化 **/
|
|
onMounted(async () => {
|
|
getList()
|
|
importTemplateData.templateUrl = await EquipmentAccountsApi.importTemplate()
|
|
})
|
|
|
|
</script>
|
|
|