对接车型培训导入
This commit is contained in:
parent
54deac0735
commit
e95fe4f759
|
@ -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'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user