对接车型培训导入

This commit is contained in:
wangchengming 2025-07-02 12:00:58 +08:00
parent 54deac0735
commit e95fe4f759
2 changed files with 14 additions and 42 deletions

View File

@ -48,7 +48,10 @@ export function importVehicleModelTraining(data) {
return request({
url: '/admin/vehicleModelTraining/import',
method: 'post',
params: data
data,
headers: {
'Content-Type': 'multipart/form-data'
}
})
}

View File

@ -37,8 +37,7 @@
</div>
<div class="submitTool">
<el-button class="cancelApplyBtn" @click="handleCancel">取消</el-button>
<!-- <el-button class="submitApplyBtn" @click="handleSubmit">提交</el-button> -->
<el-button class="cancelApplyBtn" @click="handleCancel">取消</el-button>
</div>
</div>
@ -64,27 +63,24 @@ const data = reactive({
const { ruleForm, rules } = toRefs(data)
const docUploadList = ref([])
// const baseUrl = import.meta.env.VITE_APP_BASE_API //
//
const requestDocUpload = (file) => {
const requestDocUpload = (options) => {
const { file } = options
var formData = new FormData();
formData.append('file', file.file);
formData.append('file', file);
importVehicleModelTraining(formData).then(res => {
console.log('导入结果', res)
if (res.code == 200) {
// docUploadList.value.push({ name: res.originalFilenames, url: baseUrl + res.fileNames })
// ruleForm.value.docList.push({ fileName: res.originalFilenames, relatedData: res.fileNames, fileType: res.suffix, fileSuffix: res.suffix, fileSize: res.size })
router.push({
path: '/qualification/vehicleTrain'
})
} else {
proxy.$modal.msgError(res.msg);
}
// const cur = loadingNotifys.value.findIndex(item => item.name === file.file.name)
// loadingNotifys.value[cur].notify.close()
// proxy.$modal.msgSuccess(file.file.name + ' ')
// loadingNotifys.value.splice(cur, 1)
})
}
//
const beforeDocUpload = (file) => {
console.log('fsdfsa', file)
const type = [
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
];
@ -100,9 +96,6 @@ const removeDocUpload = (file, fileList) => {
docUploadList.value = docUploadList.value.filter(
item => item.name != file.name
);
// this.form.docList = this.form.docList.filter(
// item => item.fileName != file.name
// );
}
const handleCancel = () => {
@ -110,31 +103,7 @@ const handleCancel = () => {
router.push({
path: '/qualification/vehicleTrain'
})
}
const handleSubmit = () => {
proxy.$refs["ruleFormRef"].validate(valid => {
if (valid) {
router.push({
path: '/qualification/vehicleTrain'
})
// if (form.value.roleId != undefined) {
// form.value.menuIds = getMenuAllCheckedKeys()
// updateRole(form.value).then(response => {
// proxy.$modal.msgSuccess("")
// open.value = false
// getList()
// })
// } else {
// form.value.menuIds = getMenuAllCheckedKeys()
// addRole(form.value).then(response => {
// proxy.$modal.msgSuccess("")
// open.value = false
// getList()
// })
// }
}
})
}
}
</script>
<style lang='scss'>
.app-main {