|
@ -258,35 +258,47 @@ export default { |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<template v-else-if="editFormMode==='import'"> |
|
|
<template v-else-if="editFormMode==='import'"> |
|
|
<el-form :model="importModel" style="height:100%;"> |
|
|
<app-form |
|
|
<!-- <el-form-item :label="$t('导入模板')"> |
|
|
inline |
|
|
|
|
|
mode="import" |
|
|
|
|
|
label-position="left" |
|
|
|
|
|
:schema="config.import.schema" |
|
|
|
|
|
v-model="importModel" |
|
|
|
|
|
:hideButton="true" |
|
|
|
|
|
:isQueryForm="true" |
|
|
|
|
|
> |
|
|
|
|
|
<el-form :model="importModel" style="height:100%;"> |
|
|
|
|
|
<!-- <el-form-item :label="$t('导入模板')"> |
|
|
<el-link type="primary" @click="getImportTemplate">{{$t('下载')}}</el-link> |
|
|
<el-link type="primary" @click="getImportTemplate">{{$t('下载')}}</el-link> |
|
|
</el-form-item> --> |
|
|
</el-form-item> --> |
|
|
<el-form-item label="选择工厂" label-width="80px"> |
|
|
<!-- <el-form-item label="是否为备件" label-width="100px"> |
|
|
<el-select v-model="importModel.version"> |
|
|
<el-select v-model="importModel.version"> |
|
|
<el-option v-for="item in versions" :value="item.value" :label="item.label" /> |
|
|
<el-option v-for="item in versions" :value="item.value" :label="item.label" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> --> |
|
|
<el-form-item label="选择期间" label-width="80px"> |
|
|
<!-- <el-form-item label="选择期间" label-width="80px"> |
|
|
<el-select v-model="importModel.factory"> |
|
|
<el-select v-model="importModel.factory"> |
|
|
<el-option v-for="item in versions" :value="item.value" :label="item.label" /> |
|
|
<el-option v-for="item in versions" :value="item.value" :label="item.label" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> --> |
|
|
<el-form-item :label="$t('文件')" label-width="80px"> |
|
|
<el-form-item :label="$t('文件')" label-width="80px"> |
|
|
<el-upload |
|
|
<el-upload |
|
|
ref="uploadRef" |
|
|
ref="uploadRef" |
|
|
class="upload" |
|
|
class="upload" |
|
|
drag |
|
|
drag |
|
|
accept=".xlsx" |
|
|
accept=".xlsx" |
|
|
:auto-upload="false" |
|
|
:auto-upload="false" |
|
|
:on-change="handleChange" |
|
|
:on-change="handleChange" |
|
|
> |
|
|
> |
|
|
<el-icon class="el-icon--upload"><ep-upload-filled /></el-icon> |
|
|
<el-icon class="el-icon--upload"><ep-upload-filled /></el-icon> |
|
|
</el-upload> |
|
|
</el-upload> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
|
|
|
</app-form> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<template v-else-if="editFormMode==='filter'"> |
|
|
<template v-else-if="editFormMode==='filter'"> |
|
|
<el-form :model="filterList" inline class="filter"> |
|
|
<el-form :model="filterList" inline class="filter"> |
|
|
<el-row v-for="(item,index) in filterList.filter(o=>!o.hidden)"> |
|
|
<el-row v-for="(item,index) in filterList.filter(o=>!o.hidden)"> |
|
@ -429,11 +441,9 @@ export default { |
|
|
enumBusinessType: route.meta.enumBusinessType, |
|
|
enumBusinessType: route.meta.enumBusinessType, |
|
|
}; |
|
|
}; |
|
|
const exportModel = ref(defaultExportModel); |
|
|
const exportModel = ref(defaultExportModel); |
|
|
const defaultImportModel = { |
|
|
const defaultImportModel = config.import?.schema ? schemaToModel(config.import.schema) : {}; |
|
|
factory: "", |
|
|
const importModel = ref(defaultImportModel); |
|
|
version: "", |
|
|
|
|
|
}; |
|
|
|
|
|
const importModel = ref(defaultExportModel); |
|
|
|
|
|
const factories = ref([]); |
|
|
const factories = ref([]); |
|
|
const versions = ref([]); |
|
|
const versions = ref([]); |
|
|
const fileList = ref([]); |
|
|
const fileList = ref([]); |
|
@ -688,8 +698,15 @@ export default { |
|
|
editFormloading.value = true; |
|
|
editFormloading.value = true; |
|
|
const url = config.edit.importUrl; |
|
|
const url = config.edit.importUrl; |
|
|
const formData = new FormData(); |
|
|
const formData = new FormData(); |
|
|
formData.append("version", importModel.value.version); |
|
|
// formData.append("version", importModel.value.version);
|
|
|
formData.append("factory", importModel.value.factory); |
|
|
// // formData.append("factory", importModel.value.factory);
|
|
|
|
|
|
// Object.keys(importModel.value).forEach((q) => {if(importModel.value)
|
|
|
|
|
|
Object.keys(importModel.value).forEach((q) => { |
|
|
|
|
|
if (importModel.value[q]) { |
|
|
|
|
|
formData.append(q, importModel.value[q]); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
for (let i = 0; i < fileList.value.length; i++) { |
|
|
for (let i = 0; i < fileList.value.length; i++) { |
|
|
formData.append(`files`, fileList.value[i].raw); |
|
|
formData.append(`files`, fileList.value[i].raw); |
|
|
} |
|
|
} |
|
@ -828,6 +845,20 @@ export default { |
|
|
} |
|
|
} |
|
|
return postData; |
|
|
return postData; |
|
|
} |
|
|
} |
|
|
|
|
|
function buildImport() { |
|
|
|
|
|
importModel.value.maxResultCount = pageModel.pageSize; |
|
|
|
|
|
importModel.value.skipCount = (pageModel.pageIndex - 1) * pageModel.pageSize; |
|
|
|
|
|
//
|
|
|
|
|
|
const postData = JSON.parse(JSON.stringify(importModel.value)); |
|
|
|
|
|
postData.filters = filterList.value.filter((o) => o.column && o.action && (o.value || o.value === false)); |
|
|
|
|
|
if (postData.items) { |
|
|
|
|
|
delete postData["items"]; |
|
|
|
|
|
} |
|
|
|
|
|
if (postData.import?.id) { |
|
|
|
|
|
delete postData.import["id"]; |
|
|
|
|
|
} |
|
|
|
|
|
return postData; |
|
|
|
|
|
} |
|
|
function isNotJit() { |
|
|
function isNotJit() { |
|
|
return ( |
|
|
return ( |
|
|
route.meta.enumBusinessType !== "ZhiGongJian" || |
|
|
route.meta.enumBusinessType !== "ZhiGongJian" || |
|
|