Commit ce8a5d1d authored by xinzhedeai's avatar xinzhedeai

企业先定下

parent 274fed3b
This diff is collapsed.
......@@ -25,6 +25,9 @@
@click="item.callback.call(_self, $event)"
>{{ item.name }}</el-button
>
<!-- <el-button type="primary" size="mini" icon="el-icon-upload" @click="dialogVisible=true">导入企业基础信息</el-button>
<el-button type="primary" size="mini" icon="el-icon-upload">导入企业经营信息</el-button> -->
</div>
<div>
<el-button
......@@ -60,6 +63,45 @@
:cancel="cancelForm"
:watchKeys="['paperfilename']"
/>
<!-- 导入 -->
<!-- <el-dialog
title="上传 Excel 模板"
:visible.sync="dialogVisible"
width="400px"
>
<el-form>
<el-form-item>
<el-upload
class="upload-demo"
drag
action="https://jsonplaceholder.typicode.com/posts/"
:on-success="handleSuccess"
:before-upload="beforeUpload"
accept=".xls, .xlsx"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">只能上传xls/xlsx文件,且不超过500kb</div>
<el-button
slot="tip"
type="text"
size="small"
@click="downloadTemplate"
>下载模板</el-button>
</el-upload>
</el-form-item>
<el-form-item>
<el-checkbox v-model="hasBasicInfo">是否已存在企业基础信息数据</el-checkbox>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submitImport">确 定</el-button>
</span>
</el-dialog> -->
<div
id="basicView"
......@@ -149,7 +191,9 @@ export default {
},
data() {
return {
dialogVisible: false,
uploadError: '',
hasBasicInfo: false,
Dict: { selectList: [] },
table: {
page: 1,
......@@ -217,6 +261,7 @@ export default {
});
},
watch: {
// "form.item.isHighGrowthInnovative"(newVal, oldVal) {
// this.toggleDateElement("highGrowthInnovativeDate");
// },
......@@ -282,6 +327,28 @@ export default {
// },
},
methods: {
beforeUpload(file) {
// 这里可以加入文件格式校验等
const isExcel = file.type === 'application/vnd.ms-excel' || file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
if (!isExcel) {
this.uploadError = '请上传 Excel 文件!';
} else {
this.uploadError = '';
}
return isExcel;
},
handleSuccess(response, file) {
console.log('上传成功:', response);
},
downloadTemplate() {
// 替换为下载模板的链接
window.open('YOUR_TEMPLATE_URL', '_blank');
},
submitImport() {
// 提交逻辑
console.log('是否已存在信息:', this.hasBasicInfo);
this.dialogVisible = false;
},
toggleDateElement(targetEleClass, flag) {
const elements = document.getElementsByClassName(targetEleClass);
if (elements.length) {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment