Browse Source

Json形式传值

master
wbc 2 weeks ago
parent
commit
bbe38ec5ae
  1. 14
      src/views/performanceIndicator/templateContent/addTemplate.vue

14
src/views/performanceIndicator/templateContent/addTemplate.vue

@ -26,7 +26,12 @@
<a-row :gutter="[16, 16]">
<a-col :span="24">
<a-form-item label="模板" name="file">
<a-upload v-model:file-list="fileLists" :before-upload="beforeUpload" :multiple="false" :maxCount="1">
<a-upload
v-model:file-list="fileLists"
:before-upload="beforeUpload"
:multiple="false"
:maxCount="1"
>
<a-button type="primary"> 上传 </a-button>
</a-upload>
</a-form-item>
@ -74,19 +79,20 @@
if (fileLists.value.length > 0) {
let params = {};
params.file = form.file;
params.performance = {
const performance = {
name: form.name,
superLeader: form.superLeader,
dutyWorkplace: form.dutyWorkplace,
};
params.name = params.name
params.performance = JSON.stringify(performance)
params.name = params.name;
addPerformance(params).then((_) => {
message.success('新增成功');
emit('success');
closeModal();
});
} else {
message.warning('请上传模板')
message.warning('请上传模板');
}
}
});

Loading…
Cancel
Save