餐饮记录新增导入

打卡详情新增打卡照片数据
This commit is contained in:
andy 2025-12-09 11:35:24 +08:00
parent d93d55cecd
commit 859375e0f9
3 changed files with 83 additions and 4 deletions

View File

@ -199,7 +199,14 @@
:color="activity.color"
:size="activity.size"
:timestamp="activity.timestamp">
{{activity.content}}
<div style="display: flex; align-items: center;">
<el-image style="width: 40px; height: 40px; margin-left: 20px;" :src="activity.photo" :preview-src-list="[activity.photo]">
<div slot="error" class="image-slot" style="color: darkgray;">
暂无图片
</div>
</el-image>
{{activity.content}}
</div>
</el-timeline-item>
</el-timeline>
</div>

View File

@ -84,7 +84,7 @@
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['param:params:edit']"
v-hasPermi="['attendance:params:edit']"
>修改</el-button>
</template>
</el-table-column>

View File

@ -51,6 +51,16 @@
v-hasPermi="['api:v2:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['api:v2:import']"
>导入信息</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -124,13 +134,39 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog :title="upload.title" v-dialog-drag :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<h3 style="color: red;">仅允许导入xlsxlsx格式文件</h3>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listStaffAll } from '@/api/system/staff';
import { listDetail, addDetail} from "@/api/restaurant/detail";
import { getToken } from "@/utils/auth";
export default {
name: "RestaurantDetail",
data() {
@ -176,7 +212,19 @@ export default {
sign: [
{ required: true, message: "请选择餐饮类型", trigger: "blur" },
],
}
},
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + "api/v2/import"
},
};
},
created() {
@ -250,6 +298,30 @@ export default {
}
});
},
handleImport() {
this.upload.title = "餐饮信息导入";
this.upload.open = true;
},
//
submitFileForm() {
this.$refs.upload.submit();
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
}
}
};
</script>