Browse Source

检验方案导入

master_hella_20240701
zhaoyiran 6 months ago
parent
commit
11961b1862
  1. 5
      src/api/qms/inspectionScheme/index.ts
  2. 22
      src/views/qms/inspectionScheme/index.vue

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

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

22
src/views/qms/inspectionScheme/index.vue

@ -49,6 +49,8 @@
@submitForm="submitForm" @submitForm="submitForm"
/> />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/qms/inspection-scheme/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -60,6 +62,8 @@ import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import AddForm from './addForm.vue' import AddForm from './addForm.vue'
import * as InspectionSchemeApi from '@/api/qms/inspectionScheme' import * as InspectionSchemeApi from '@/api/qms/inspectionScheme'
import ImportForm from "../../../components/ImportForm/src/ImportForm.vue";
import * as SampleCodeApi from "@/api/qms/sampleCode";
defineOptions({ name: 'InspectionScheme' }) defineOptions({ name: 'InspectionScheme' })
@ -86,7 +90,7 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'qms:type-template:create'}), // defaultButtons.defaultAddBtn({hasPermi:'qms:type-template:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:agv-locationrelation:import'}), // defaultButtons.defaultImportBtn({hasPermi:'qms:inspection-scheme:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'wms:agv-locationrelation:export'}), // // defaultButtons.defaultExportBtn({hasPermi:'wms:agv-locationrelation:export'}), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
@ -240,9 +244,25 @@ const searchFormClick = (searchData) => {
getList() // getList() //
} }
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '检验方案导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await InspectionSchemeApi.importTemplate()
}) })
</script> </script>

Loading…
Cancel
Save