Browse Source

EAM ——> 基础数据 备件管理 导入导出

master_hella_20240701
gaojs 6 months ago
parent
commit
1cee041840
  1. 2
      src/views/eam/sparePart/index.vue
  2. 11
      src/views/eam/sparePart/sparePart.data.ts

2
src/views/eam/sparePart/index.vue

@ -54,7 +54,7 @@
<Detail ref="detailRef" :isBasic="true" :allSchemas="SparePart.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="SparePart.allSchemas" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/spare-part/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/eam/basic/spare-part/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">

11
src/views/eam/sparePart/sparePart.data.ts

@ -1,6 +1,13 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as ConfigApi from '@/api/infra/config'
const autoCodeSwitch = await ConfigApi.getConfigKey('sparePartCodeAutoSwitch')
const autoSwitch = ref(false)
if (autoCodeSwitch == 'TRUE') {
autoSwitch.value = true
}
// 表单校验 // 表单校验
export const SparePartRules = reactive({ export const SparePartRules = reactive({
code: [required], code: [required],
@ -21,10 +28,10 @@ export const SparePart = useCrudSchemas(reactive<CrudSchema[]>([
isDetail:false, isDetail:false,
}, },
{ {
label: '编号', label: '备件编号',
field: 'code', field: 'code',
sort: 'custom', sort: 'custom',
isForm: false, isForm: !autoSwitch.value,
isSearch: true, isSearch: true,
fixed: 'left' fixed: 'left'
}, },

Loading…
Cancel
Save