|
|
@ -69,24 +69,19 @@ |
|
|
|
@detailOpenForm="detailOpenForm" |
|
|
|
/> |
|
|
|
<BasicForm |
|
|
|
ref="teamListRef" |
|
|
|
ref="tmpPopListRef" |
|
|
|
:formAllSchemas="tmpPopList" |
|
|
|
:isBusiness="false" |
|
|
|
/> |
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/mes/workstation/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import download from '@/utils/download' |
|
|
|
import { |
|
|
|
Equipment, |
|
|
|
Process, |
|
|
|
Opersteps, |
|
|
|
TabsList, |
|
|
|
Team, |
|
|
|
Workstation, |
|
|
|
WorkstationRules,equipmentPopList,processPopList,stepPopList |
|
|
|
WorkstationRules,equipmentPopList,stepPopList |
|
|
|
} from './workstation.data' |
|
|
|
import * as WorkstationApi from '@/api/mes/workstation' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
@ -130,8 +125,8 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:workstation:create'}), // 新增 |
|
|
|
defaultButtons.defaultImportBtn({hasPermi:'wms:workstation:import'}), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:workstation:export'}), // 导出 |
|
|
|
// defaultButtons.defaultImportBtn({hasPermi:'wms:workstation:import'}), // 导入 |
|
|
|
// defaultButtons.defaultExportBtn({hasPermi:'wms:workstation:export'}), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
@ -148,10 +143,6 @@ const HeadButttondata = [ |
|
|
|
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') { // 筛选 |
|
|
@ -218,37 +209,6 @@ const handleDelete = async (id: number) => { |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
|
const handleExport = async () => { |
|
|
|
try { |
|
|
|
// 导出的二次确认 |
|
|
|
await message.exportConfirm() |
|
|
|
// 发起导出 |
|
|
|
exportLoading.value = true |
|
|
|
const data = await WorkstationApi.exportWorkstation(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 = { |
|
|
@ -261,7 +221,6 @@ const searchFormClick = (searchData) => { |
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|
importTemplateData.templateUrl = await WorkstationApi.importTemplate() |
|
|
|
}) |
|
|
|
/** 详情操作 */ |
|
|
|
const detailRef = ref() |
|
|
@ -270,7 +229,7 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicWorkstation') |
|
|
|
} |
|
|
|
// 子包装数据 |
|
|
|
const detailAllSchemas = ref(Team.allSchemas) |
|
|
|
const detailAllSchemas = ref(Equipment.allSchemas) |
|
|
|
const apiPage = ref(WorkstationApi.getEquipmentPage) |
|
|
|
const tableKey = ref("Team"); |
|
|
|
let tmpPopList = equipmentPopList.allSchemas |
|
|
@ -283,12 +242,6 @@ const changeTabs = (data) =>{ |
|
|
|
tabsDeleteApi = WorkstationApi.deleteEquipmentRelation |
|
|
|
tabsCreateApi = WorkstationApi.createEquipmentRelation |
|
|
|
tmpPopList = equipmentPopList.allSchemas |
|
|
|
}else if(data.prop == 'Process'){ |
|
|
|
apiPage.value = WorkstationApi.getProcessPage |
|
|
|
detailAllSchemas.value = Process.allSchemas |
|
|
|
tabsDeleteApi = WorkstationApi.deleteProcessRelation |
|
|
|
tabsCreateApi = WorkstationApi.createProcessRelation |
|
|
|
tmpPopList = processPopList.allSchemas |
|
|
|
}else if(data.prop == 'Opersteps'){ |
|
|
|
apiPage.value = WorkstationApi.getOperstepsPage |
|
|
|
detailAllSchemas.value = Opersteps.allSchemas |
|
|
@ -297,9 +250,9 @@ const changeTabs = (data) =>{ |
|
|
|
tmpPopList = stepPopList.allSchemas |
|
|
|
} |
|
|
|
} |
|
|
|
const teamListRef = ref() |
|
|
|
const tmpPopListRef = ref() |
|
|
|
|
|
|
|
const detailOpenForm = async (type, params) => { |
|
|
|
teamListRef.value.open('create', null, null, 'viewDetail')//查看明细数据 |
|
|
|
tmpPopListRef.value.open('create', null, null, 'viewDetail')//查看明细数据 |
|
|
|
} |
|
|
|
</script> |
|
|
|