Browse Source

检验方案模板导入

master_hella_20240701
zhaoyiran 5 months ago
parent
commit
779681e312
  1. 5
      src/api/qms/inspectionTemplate/index.ts
  2. 29
      src/views/qms/inspectionTemplate/index.vue

5
src/api/qms/inspectionTemplate/index.ts

@ -37,3 +37,8 @@ export const enableInspectionTemplate = async (id: number) => {
export const disableInspectionTemplate = async (id: number) => {
return await request.disable({ url: `/qms/programme-template/disable?id=` + id })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/qms/programme-template/get-import-template' })
}

29
src/views/qms/inspectionTemplate/index.vue

@ -56,7 +56,15 @@
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/agv-locationrelation/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm
ref="importFormRef"
url="/qms/programme-template/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
:updateIsDisable="true"
:coverIsDisable="true"
:mode="2"
/>
</template>
<script setup lang="ts">
@ -94,7 +102,7 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:programme-template:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:agv-locationrelation:import'}), //
defaultButtons.defaultImportBtn({hasPermi:'qms:programme-template:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'wms:agv-locationrelation:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
@ -220,9 +228,26 @@ const searchFormClick = (searchData) => {
getList() //
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '检验方案导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await InspectionProcessPageApi.importTemplate()
})
</script>

Loading…
Cancel
Save