切换导航条
此项目
正在载入...
登录
朱兆平
/
vue_cli
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
差异文件
浏览文件
作者
朱兆平
about a year ago
提交
dbee94b469cad538f14952d85af80c2a6f318d53
2 个父辈
a0064a7b
5484016c
Merge remote-tracking branch 'origin/master_dev' into master_dev
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
116 行增加
和
44 行删除
src/views/deploy/conveyance.vue
src/views/deploy/conveyance.vue
查看文件 @
dbee94b
...
...
@@ -47,9 +47,10 @@
<el-table-column
fixed="right"
label="操作"
width="
1
20">
width="
2
20">
<template slot-scope="scope">
<el-button type="danger" size="mini" @click="applyEnd(scope.row)">结束出勤</el-button>
<el-button type="success" @click="centerDialogVisible = true">图片上传</el-button>
</template>
</el-table-column>
</el-table>
...
...
@@ -65,6 +66,31 @@
:total="total">
</el-pagination>
</el-row>
<el-dialog
title="提示"
:visible.sync="centerDialogVisible"
width="30%"
center>
<div>
<el-upload
class="avatar-uploader"
action="https://jsonplaceholder.typicode.com/posts/"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<img v-if="imageUrl" :src="imageUrl" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<el-input v-model="description" placeholder="请输入图片描述"></el-input>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
</span>
</el-dialog>
</el-card>
</el-row>
</template>
...
...
@@ -75,68 +101,114 @@
export default {
data() {
return {
centerDialogVisible: false,
queryInfo: {
lisenceNo:'',
lisenceNo:
'',
// 当前页数
pageNum: 1,
// 每页几条数据
pageSize: 10,
},
total: 0,
tableData:[],
tableData: [],
formInline: {
user: '',
},
imageUrl: '',
description:''
}
},
methods: {
handleSizeChange(val) {
this.queryInfo.pageSize = val
this.getList()
handleAvatarSuccess(res, file) {
this.imageUrl = URL.createObjectURL(file.raw);
},
handleCurrentChange(val) {
this.queryInfo.pageNum = val
this.getList()
},
getList() {
const _this = this
selectList(this.queryInfo).then((response) => {
const res = response.data
console.log(response.data)
if (res.code !== '200') {
return _this.$message.error('获取消息收发记录,失败!')
}
// 获取列表数据
_this.tableData = res.data.list;
// 获取列表的总记录数
_this.total = res.data.total
_this.$message.success('获取消息收发记录,成功!')
}).catch(error => {
// 关闭加载
_this.$message.error(error.toString())
})
beforeAvatarUpload(file) {
const isJPG = file.type === 'image/jpeg';
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isJPG) {
this.$message.error('上传头像图片只能是 JPG 格式!');
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!');
}
return isJPG && isLt2M;
},
// 结束出勤
applyEnd(row) {
// 弹框询问是否结束?
this.$confirm('是否继续?', '警告', {
confirmButtonText: '确定结束',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
DoneTask(row).then((response) => {
handleSizeChange(val) {
this.queryInfo.pageSize = val
this.getList()
},
handleCurrentChange(val) {
this.queryInfo.pageNum = val
this.getList()
},
getList() {
const _this = this
selectList(this.queryInfo).then((response) => {
const res = response.data
this.$message.success(res.msg)
this.getList()
console.log(response.data)
if (res.code !== '200') {
return _this.$message.error('获取消息收发记录,失败!')
}
// 获取列表数据
_this.tableData = res.data.list;
// 获取列表的总记录数
_this.total = res.data.total
_this.$message.success('获取消息收发记录,成功!')
}).catch(error => {
this.$message.error(error)
// 关闭加载
_this.$message.error(error.toString())
})
}).catch(() => {
})
},
// 结束出勤
applyEnd(row) {
// 弹框询问是否结束?
this.$confirm('是否继续?', '警告', {
confirmButtonText: '确定结束',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
DoneTask(row).then((response) => {
const res = response.data
this.$message.success(res.msg)
this.getList()
}).catch(error => {
this.$message.error(error)
})
}).catch(() => {
})
},
},
},
mounted() {
this.getList();
}
}
</script>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style>
...
...
请
注册
或
登录
后发表评论