餐饮记录新增导入
打卡详情新增打卡照片数据
This commit is contained in:
parent
d93d55cecd
commit
859375e0f9
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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;">仅允许导入xls、xlsx格式文件。</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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user