Commit 59212aa5 authored by 姬鋆屾's avatar 姬鋆屾

feated:对列表优化显示及头像优化显示,增加复职功能,修改bug

parent 1e802661
...@@ -25,6 +25,7 @@ export default { ...@@ -25,6 +25,7 @@ export default {
this.changePath("device"); this.changePath("device");
} }
this.query = Object.assign({}, this.query, route.query); this.query = Object.assign({}, this.query, route.query);
this.getData(); this.getData();
}, },
}, },
...@@ -63,6 +64,14 @@ export default { ...@@ -63,6 +64,14 @@ export default {
return; return;
} }
this.tableData.loading = true; this.tableData.loading = true;
console.log(this.query);
if (this.$route.path == "/user/list") {
this.query.userType
? (this.query.userTypeList = [])
: "userType" in this.query
? (this.query.userTypeList = [])
: (this.query.userTypeList = ["0", "1"]);
}
this.$post(this.pageInfo.list, this.query, { this.$post(this.pageInfo.list, this.query, {
cancelToken: this.source.token, cancelToken: this.source.token,
}) })
......
exports.install = function (Vue) { exports.install = function(Vue) {
// 把需要暴露出去的方法挂载到Vue原型上,避免了全局变量过多的问题 // 把需要暴露出去的方法挂载到Vue原型上,避免了全局变量过多的问题
Vue.prototype.refreshData = function () { Vue.prototype.refreshData = function() {
console.log("刷新设备列表");
console.log("刷新设备列表") const component = findComponentDownward(this, "Device");
const component = findComponentDownward(this, 'Device') console.log("component", component);
console.log("component",component) if (component) {
if(component){ component.getData();
component.getData()
}
}
} }
};
};
/** /**
* 由一个组件,向下找到最近的指定组件 * 由一个组件,向下找到最近的指定组件
* @param {*} context 当前上下文,比如你要基于哪个组件来向上寻找,一般都是基于当前的组件,也就是传入 this * @param {*} context 当前上下文,比如你要基于哪个组件来向上寻找,一般都是基于当前的组件,也就是传入 this
* @param {*} componentName 要找的组件的 name * @param {*} componentName 要找的组件的 name
*/ */
function findComponentDownward(context, componentName) { function findComponentDownward(context, componentName) {
const childrens = context.$children const childrens = context.$children;
let children = null let children = null;
if (childrens.length) { if (childrens.length) {
for (const child of childrens) { for (const child of childrens) {
const name = child.$options.name const name = child.$options.name;
if (name === componentName) { if (name === componentName) {
children = child children = child;
break break;
} else { } else {
children = findComponentDownward(child, componentName) children = findComponentDownward(child, componentName);
if (children) break if (children) break;
}
} }
} }
return children
} }
return children;
\ No newline at end of file }
...@@ -53,8 +53,7 @@ ...@@ -53,8 +53,7 @@
@click="handleDelete(index)" @click="handleDelete(index)"
type="danger" type="danger"
>删除 >删除
</el-link </el-link>
>
</div> </div>
</li> </li>
</transition-group> </transition-group>
...@@ -62,7 +61,6 @@ ...@@ -62,7 +61,6 @@
</template> </template>
<script> <script>
export default { export default {
props: { props: {
// 值 // 值
...@@ -86,18 +84,18 @@ export default { ...@@ -86,18 +84,18 @@ export default {
// 是否显示提示 // 是否显示提示
isShowTip: { isShowTip: {
type: Boolean, type: Boolean,
default: true default: true,
}, },
//保存服务器路径前缀地址 //保存服务器路径前缀地址
prePath: { prePath: {
type: String, type: String,
default: '', default: "",
}, },
//默认文件名称 //默认文件名称
fileName: { fileName: {
type: String, type: String,
default: '', default: "",
} },
}, },
data() { data() {
return { return {
...@@ -112,14 +110,14 @@ export default { ...@@ -112,14 +110,14 @@ export default {
watch: { watch: {
value: { value: {
handler(val) { handler(val) {
if (val&&val!=='') { if (val && val !== "") {
this.showFileList(); this.showFileList();
} else { } else {
this.fileList = []; this.fileList = [];
return []; return [];
} }
} },
} },
}, },
computed: { computed: {
...@@ -129,16 +127,15 @@ export default { ...@@ -129,16 +127,15 @@ export default {
}, },
}, },
methods: { methods: {
showFileList() {
showFileList(){
let temp = 1; let temp = 1;
// 首先将值转为数组 // 首先将值转为数组
const filePathlist = this.value.split(','); const filePathlist = this.value.split(",");
// 然后将数组转为对象数组 // 然后将数组转为对象数组
const fileNamelist =this.fileName.split(','); const fileNamelist = this.fileName.split(",");
for (var i = 0; i < filePathlist.length; i++) { for (var i = 0; i < filePathlist.length; i++) {
if(filePathlist[i]==='') continue if (filePathlist[i] === "") continue;
let item = {} let item = {};
if (fileNamelist.length === filePathlist.length) { if (fileNamelist.length === filePathlist.length) {
item.name = fileNamelist[i]; item.name = fileNamelist[i];
} else { } else {
...@@ -146,11 +143,10 @@ export default { ...@@ -146,11 +143,10 @@ export default {
} }
item.url = filePathlist[i]; item.url = filePathlist[i];
item.uid = new Date().getTime() + temp++; item.uid = new Date().getTime() + temp++;
this.fileList.push(item) this.fileList.push(item);
} }
}, },
// 上传前校检格式和大小 // 上传前校检格式和大小
handleBeforeUpload(file) { handleBeforeUpload(file) {
// 校检文件类型 // 校检文件类型
...@@ -165,7 +161,9 @@ export default { ...@@ -165,7 +161,9 @@ export default {
return false; return false;
}); });
if (!isTypeOk) { if (!isTypeOk) {
this.$message.error(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`); this.$message.error(
`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
);
return false; return false;
} }
} }
...@@ -190,13 +188,17 @@ export default { ...@@ -190,13 +188,17 @@ export default {
// 上传成功回调 // 上传成功回调
handleUploadSuccess(res, file) { handleUploadSuccess(res, file) {
if (res.code === 1) { if (res.code === 1) {
this.fileList.push({name: res.fileName, url: res.url, uid: new Date().getTime()}); this.fileList.push({
name: res.fileName,
url: res.url,
uid: new Date().getTime(),
});
let newFileList = this.fileList.map(i => i.url); let newFileList = this.fileList.map((i) => i.url);
let newFileNameList = this.fileList.map(i => i.name); let newFileNameList = this.fileList.map((i) => i.name);
this.$emit("input", newFileList.join(",")); this.$emit("input", newFileList.join(","));
this.$emit("getFileName", newFileNameList.join(",")); this.$emit("getFileName", newFileNameList.join(","));
this.fileList =[] this.fileList = [];
this.$message.success("上传成功"); this.$message.success("上传成功");
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
...@@ -206,11 +208,11 @@ export default { ...@@ -206,11 +208,11 @@ export default {
handleDelete(index) { handleDelete(index) {
//todo 删除文件 //todo 删除文件
this.fileList.splice(index, 1); this.fileList.splice(index, 1);
let newFileList = this.fileList.map(i => i.url); let newFileList = this.fileList.map((i) => i.url);
let newFileNameList = this.fileList.map(i => i.name); let newFileNameList = this.fileList.map((i) => i.name);
this.$emit("input", newFileList.join(",")); this.$emit("input", newFileList.join(","));
this.$emit("getFileName", newFileNameList.join(",")); this.$emit("getFileName", newFileNameList.join(","));
this.fileList =[] this.fileList = [];
// this.$emit("input", ''); // this.$emit("input", '');
}, },
// 获取文件名称 // 获取文件名称
...@@ -220,11 +222,14 @@ export default { ...@@ -220,11 +222,14 @@ export default {
} else { } else {
return name; return name;
} }
} },
}, },
created() { created() {
console.log("file create") this.$nextTick(() => {
console.log(this.list);
this.showFileList(); this.showFileList();
});
// this.fileList = this.list; // this.fileList = this.list;
}, },
}; };
......
<template>
<div>
<el-image
v-for="val in realSrcList"
:key="val"
:src="`${val}`"
fit="cover"
:style="`width:${realWidth};height:${realHeight};margin-right:10px;margin-bottom:10px`"
:preview-src-list="realSrcList"
>
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"></i>
</div>
</el-image>
</div>
</template>
<script>
export default {
name: "ImagePreview",
props: {
src: {
type: String,
required: true,
},
width: {
type: [Number, String],
default: "",
},
height: {
type: [Number, String],
default: "",
},
},
computed: {
realSrc() {
let real_src = this.src.split(",");
return real_src;
},
realSrcList() {
let real_src_list = this.src.split(",");
let srcList = [];
real_src_list.forEach((item) => {
return srcList.push(item);
});
return srcList;
},
realWidth() {
return typeof this.width == "string" ? this.width : `${this.width}px`;
},
realHeight() {
return typeof this.height == "string" ? this.height : `${this.height}px`;
},
},
};
</script>
<style lang="scss" scoped>
.el-image {
border-radius: 5px;
background-color: #ebeef5;
box-shadow: 0 0 5px 1px #ccc;
::v-deep .el-image__inner {
transition: all 0.3s;
cursor: pointer;
&:hover {
transform: scale(1.2);
}
}
::v-deep .image-slot {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
color: #909399;
font-size: 30px;
}
}
</style>
...@@ -256,6 +256,7 @@ export default { ...@@ -256,6 +256,7 @@ export default {
} }
}); });
this.form = Object.assign({}, this.form, newFormData); this.form = Object.assign({}, this.form, newFormData);
//this.form = Object.assign({}, this.form, data); //this.form = Object.assign({}, this.form, data);
}, },
cleanForm() { cleanForm() {
...@@ -277,6 +278,11 @@ export default { ...@@ -277,6 +278,11 @@ export default {
onSubmit() { onSubmit() {
let { path, query } = this.$route; let { path, query } = this.$route;
let data = this.decode(this.form); let data = this.decode(this.form);
for (let val in data) {
if (val == "userType") {
query.userTypeList = [];
}
}
this.$router.push({ this.$router.push({
path: path, path: path,
query: Object.assign({}, query, data), query: Object.assign({}, query, data),
......
...@@ -3,15 +3,22 @@ ...@@ -3,15 +3,22 @@
<template> <template>
<div class="my-upload"> <div class="my-upload">
<label> <label>
<el-button icon='el-icon-upload' size='mini' :loading='loading'>{{loading ? '上传中...' : tip}}</el-button> <el-button icon="el-icon-upload" size="mini" :loading="loading">{{
<input type="file" @change='chooseFile' :disabled="loading" ref="referenceUpload"> loading ? "上传中..." : tip
}}</el-button>
<input
type="file"
@change="chooseFile"
:disabled="loading"
ref="referenceUpload"
/>
</label> </label>
<div v-if='value' class='flex'> <div v-if="value" class="flex">
<div style="margin-right: 20px"> <div style="margin-right: 20px">
<div v-if='type === "thumb"' class='thumb' :style="imgCover"></div> <div v-if="type === 'thumb'" class="thumb" :style="imgCover"></div>
<div v-else>文件名: {{value}}</div> <div v-else>文件名: {{ value }}</div>
</div> </div>
<!-- <div> <!-- <div>
<el-button icon="el-icon-delete" size='mini' plain @click='del'>删除</el-button> <el-button icon="el-icon-delete" size='mini' plain @click='del'>删除</el-button>
</div>--> </div>-->
</div> </div>
...@@ -23,37 +30,39 @@ export default { ...@@ -23,37 +30,39 @@ export default {
props: { props: {
value: { value: {
type: String, type: String,
default: '', default: "",
}, },
type: { // 展示类型,文件名或缩略图 filename | thumb type: {
// 展示类型,文件名或缩略图 filename | thumb
type: String, type: String,
default: 'filename', default: "filename",
}, },
tip: { // 按钮文字 tip: {
// 按钮文字
type: String, type: String,
default: '上传文件', default: "上传文件",
}, },
prePath: { prePath: {
type: String, type: String,
default: '', default: "",
} },
}, },
methods: { methods: {
del() { del() {
this.$emit("input", "") this.$emit("input", "");
}, },
async chooseFile(e) { async chooseFile(e) {
this.loading = true; this.loading = true;
console.log(e); console.log(e);
try { try {
const {code, url} = await this.$upload('file/upload', { const { code, url } = await this.$upload("file/upload", {
uploadFile: e.target.files[0], uploadFile: e.target.files[0],
prePath: this.prePath prePath: this.prePath,
}); });
if(code === 1) { if (code === 1) {
this.$emit('input', url) this.$emit("input", url);
}else{ } else {
this.$message.error('上传文件失败'); this.$message.error("上传文件失败");
} }
} catch (error) { } catch (error) {
this.$message.error(error.message); this.$message.error(error.message);
...@@ -65,21 +74,21 @@ export default { ...@@ -65,21 +74,21 @@ export default {
computed: { computed: {
imgCover() { imgCover() {
return `background-image: url(${this.value})`; return `background-image: url(${this.value})`;
} },
}, },
data() { data() {
return { return {
loading: false, loading: false,
} };
} },
} };
</script> </script>
<style lang="less"> <style lang="less">
.my-upload{ .my-upload {
label{ label {
position: relative; position: relative;
input{ input {
display: block; display: block;
position: absolute; position: absolute;
width: 100%; width: 100%;
...@@ -89,7 +98,7 @@ export default { ...@@ -89,7 +98,7 @@ export default {
opacity: 0; opacity: 0;
} }
} }
.thumb{ .thumb {
width: 80px; width: 80px;
height: 80px; height: 80px;
background-size: contain; background-size: contain;
...@@ -99,7 +108,7 @@ export default { ...@@ -99,7 +108,7 @@ export default {
border-radius: 5px; border-radius: 5px;
overflow: hidden; overflow: hidden;
} }
p{ p {
color: #666; color: #666;
font-size: 14px; font-size: 14px;
} }
......
...@@ -61,7 +61,18 @@ export default { ...@@ -61,7 +61,18 @@ export default {
style="width: 70px; height: 70px" style="width: 70px; height: 70px"
src={row.photoPath} src={row.photoPath}
preview-src-list={[row.photoPath]} preview-src-list={[row.photoPath]}
></el-image> >
<div
slot="error"
class="image-slot"
style="width: 70px; height: 70px;display:flex;justify-content: center;align-items: center;"
>
<i
class="el-icon-picture-outline"
style="font-size:26px"
></i>
</div>
</el-image>
) : ( ) : (
"--" "--"
); );
......
...@@ -101,7 +101,18 @@ export default { ...@@ -101,7 +101,18 @@ export default {
style="width: 70px; height: 70px" style="width: 70px; height: 70px"
src={row.photoPath} src={row.photoPath}
preview-src-list={[row.photoPath]} preview-src-list={[row.photoPath]}
></el-image> >
<div
slot="error"
class="image-slot"
style="width: 70px; height: 70px;display:flex;justify-content: center;align-items: center;"
>
<i
class="el-icon-picture-outline"
style="font-size:26px"
></i>
</div>
</el-image>
) : ( ) : (
"--" "--"
); );
......
...@@ -45,8 +45,32 @@ ...@@ -45,8 +45,32 @@
</div> </div>
<div class="jyitem"> <div class="jyitem">
<div class="leftlabel">附件</div> <div class="leftlabel">附件</div>
<!-- <Field label="附件名称,多个逗号分割" prop="fileName" v-model="form.fileName" placeholder="请输入附件名称,多个逗号分割"/> <image-preview-single
<Field label="附件地址,多个逗号分割"><fileUpload v-model="form.filePath" prePath="/file/fileupload"/></Field> --> v-if="form.filePath && form.filePath != ''"
:src="form.filePath"
:width="'100px'"
:height="'100px'"
/>
<div v-else>--</div>
<!-- <Field
label="附件名称,多个逗号分割"
prop="fileName"
v-model="form.fileName"
placeholder="请输入附件名称,多个逗号分割"
/> -->
<!-- <Field label="附件地址,多个逗号分割">
<fileUpload
v-model="form.filePath"
prePath=""
/>
</Field> -->
<!-- <el-upload
class="upload-demo"
:action="uploadFileUrl + '?prePath=' + '/file/fileupload'"
:file-list="fileList"
>
</el-upload> -->
</div> </div>
<div class="jyitem"> <div class="jyitem">
<div class="leftlabel">提交日期</div> <div class="leftlabel">提交日期</div>
...@@ -145,10 +169,11 @@ ...@@ -145,10 +169,11 @@
<script> <script>
import moment from "moment"; import moment from "moment";
import form from "@/assets/mixins/formdialog"; import form from "@/assets/mixins/formdialog";
import ImagePreviewSingle from "@/components/ImagePreviewSingle.vue";
export default { export default {
name: "FeedbackDetail", name: "FeedbackDetail",
mixins: [form], mixins: [form],
components: {}, components: { ImagePreviewSingle },
watch: { watch: {
form(newval) { form(newval) {
if (newval.createTime) { if (newval.createTime) {
...@@ -163,6 +188,8 @@ export default { ...@@ -163,6 +188,8 @@ export default {
}, },
data() { data() {
return { return {
fileList: [],
uploadFileUrl: "/enterprise/file/commonupload", // 上传的地址
createTime: "", createTime: "",
// 遮罩层 // 遮罩层
loading: true, loading: true,
...@@ -215,7 +242,7 @@ export default { ...@@ -215,7 +242,7 @@ export default {
], ],
replyContent: [ replyContent: [
{ required: true, message: "请输入回复", trigger: "blur" }, { required: true, message: "请输入回复", trigger: "blur" },
{ max: 64, message: "最多只能录入64个字符", trigger: "blur" }, { max: 200, message: "最多只能录入200个字符", trigger: "blur" },
], ],
feedbackType: [ feedbackType: [
{ required: true, message: "请输入反馈类型 ", trigger: "blur" }, { required: true, message: "请输入反馈类型 ", trigger: "blur" },
...@@ -275,6 +302,15 @@ export default { ...@@ -275,6 +302,15 @@ export default {
/**获取数据前弹框 */ /**获取数据前弹框 */
beforeRender(data) { beforeRender(data) {
data.entity.deptId = String(data.entity.deptId); data.entity.deptId = String(data.entity.deptId);
let arr = data.entity.filePath.split(",");
this.fileList = arr.map((v, i) => {
let obj = {
name: "附件" + (i + 1),
url: v,
};
return obj;
});
console.log(this.fileList);
return data; return data;
}, },
/**获取数据后弹框 */ /**获取数据后弹框 */
...@@ -376,7 +412,7 @@ export default { ...@@ -376,7 +412,7 @@ export default {
padding: 20px; padding: 20px;
} }
} }
/deep/.el-form-item__error{ /deep/.el-form-item__error {
font-size: 14px; font-size: 14px;
} }
</style> </style>
\ No newline at end of file
...@@ -132,7 +132,7 @@ export default { ...@@ -132,7 +132,7 @@ export default {
label: "真实姓名", label: "真实姓名",
prop: "feedbackName", prop: "feedbackName",
formatter: this.formatter, formatter: this.formatter,
width: 120, width: 100,
}, },
{ {
label: "联系电话", label: "联系电话",
......
...@@ -58,7 +58,18 @@ export default { ...@@ -58,7 +58,18 @@ export default {
style="width: 70px; height: 70px" style="width: 70px; height: 70px"
src={row.labelLogoPath} src={row.labelLogoPath}
preview-src-list={[row.labelLogoPath]} preview-src-list={[row.labelLogoPath]}
></el-image> >
<div
slot="error"
class="image-slot"
style="width: 70px; height: 70px;display:flex;justify-content: center;align-items: center;"
>
<i
class="el-icon-picture-outline"
style="font-size:26px"
></i>
</div>
</el-image>
) : ( ) : (
"--" "--"
); );
......
...@@ -31,6 +31,19 @@ export default { ...@@ -31,6 +31,19 @@ export default {
toView(row) { toView(row) {
this.$refs.drawerform.view(row); this.$refs.drawerform.view(row);
}, },
// 复职操作
handleReback(row) {
this.$post("/staff/leave/save", { id: row.id, staffStatus: 1 })
.then((res) => {
if (res.code == 1) {
this.$message.success("复职成功!");
this.getData();
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
}, },
data() { data() {
return { return {
...@@ -53,7 +66,7 @@ export default { ...@@ -53,7 +66,7 @@ export default {
{ type: "selection", width: 60 }, { type: "selection", width: 60 },
{ type: "index", label: "序号", width: 50 }, { type: "index", label: "序号", width: 50 },
{ label: "员工姓名", prop: "name" }, { label: "员工姓名", prop: "name", width: 120 },
{ {
label: "照片", label: "照片",
...@@ -64,33 +77,79 @@ export default { ...@@ -64,33 +77,79 @@ export default {
style="width: 70px; height: 70px" style="width: 70px; height: 70px"
src={row.photoPath} src={row.photoPath}
preview-src-list={[row.photoPath]} preview-src-list={[row.photoPath]}
></el-image> >
<div
slot="error"
class="image-slot"
style="width: 70px; height: 70px;display:flex;justify-content: center;align-items: center;"
>
<i
class="el-icon-picture-outline"
style="font-size:26px"
></i>
</div>
</el-image>
) : ( ) : (
"--" "--"
); );
}, },
width: 110, width: 100,
}, },
{ label: "邮件地址", prop: "email" }, { label: "邮件地址", prop: "email", width: 160 },
{ label: "联系电话", prop: "phoneNumber" }, { label: "联系电话", prop: "phoneNumber", width: 120 },
{ label: "所属公司", prop: "companyIds", formatter: this.formatters }, {
label: "所属公司",
prop: "companyIds",
formatter: this.formatters,
},
{ label: "职位名称", prop: "positionName" }, { label: "职位名称", prop: "positionName", width: 120 },
{
label: "员工状态",
prop: "staffStatus",
formatter: this.formatter,
width: 80,
},
{ {
label: "离职时间", label: "离职时间",
prop: "leaveDate", prop: "leaveDate",
formatter: this.formatterDate, formatter: this.formatterDate,
width: 140,
}, },
{ {
label: "操作用户", label: "操作用户",
prop: "createUserId", prop: "createUserId",
formatter: this.formatter, formatter: this.formatter,
width: 120,
}, },
// {
// label: "操作",
// width: 100,
// formatter: (row) => {
// return row.staffStatus == 3 ? (
// <div>
// <el-button
// type="text"
// icon="el-icon-refresh-left"
// size="mini"
// onClick={() => {
// this.handleReback(row);
// }}
// title="复职"
// >
// 复职
// </el-button>
// </div>
// ) : (
// "--"
// );
// },
// },
], ],
}, },
}; };
......
...@@ -30,6 +30,19 @@ export default { ...@@ -30,6 +30,19 @@ export default {
toView(row) { toView(row) {
this.$refs.drawerform.view(row); this.$refs.drawerform.view(row);
}, },
// 复职操作
handleReback(row) {
this.$post("/staff/save", { id: row.id, staffStatus: 1 })
.then((res) => {
if (res.code == 1) {
this.$message.success("复职成功!");
this.getData();
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
// 离职操作 // 离职操作
toDimission(row) { toDimission(row) {
console.log(row); console.log(row);
...@@ -59,16 +72,17 @@ export default { ...@@ -59,16 +72,17 @@ export default {
}, },
// 重写getData // 重写getData
async getData() { async getData() {
this.query = Object.assign( this.query = Object.assign(this.query, this.$route.query);
{ staffStatus: 1 },
this.query,
this.$route.query
);
try { try {
await this.beforeFecth(); await this.beforeFecth();
} catch (error) { } catch (error) {
return; return;
} }
this.query.staffStatus
? ""
: "staffStatus" in this.query
? ""
: (this.query.staffStatus = 1);
this.tableData.loading = true; this.tableData.loading = true;
this.$post(this.pageInfo.list, this.query, { this.$post(this.pageInfo.list, this.query, {
cancelToken: this.source.token, cancelToken: this.source.token,
...@@ -95,6 +109,12 @@ export default { ...@@ -95,6 +109,12 @@ export default {
return { return {
config: { config: {
search: [ search: [
{
name: "staffStatus",
type: "select",
placeholder: "请选择员工状态",
label: "员工状态",
},
{ {
name: "companyId", name: "companyId",
type: "select", type: "select",
...@@ -123,14 +143,30 @@ export default { ...@@ -123,14 +143,30 @@ export default {
style="width: 70px; height: 70px" style="width: 70px; height: 70px"
src={row.photoPath} src={row.photoPath}
preview-src-list={[row.photoPath]} preview-src-list={[row.photoPath]}
></el-image> >
<div
slot="error"
class="image-slot"
style="width: 70px; height: 70px;display:flex;justify-content: center;align-items: center;"
>
<i
class="el-icon-picture-outline"
style="font-size:26px"
></i>
</div>
</el-image>
) : ( ) : (
"--" "--"
); );
}, },
width: 110, width: 110,
}, },
{
label: "员工状态",
prop: "staffStatus",
formatter: this.formatter,
width: 80,
},
{ label: "联系电话", prop: "phoneNumber", width: 110 }, { label: "联系电话", prop: "phoneNumber", width: 110 },
{ {
...@@ -168,7 +204,38 @@ export default { ...@@ -168,7 +204,38 @@ export default {
label: "操作", label: "操作",
width: 180, width: 180,
formatter: (row) => { formatter: (row) => {
return ( return row.staffStatus == 3 ? (
<div>
<table-buttons
noAdd
noView
row={row}
onEdit={this.toEdit}
onView={this.toView}
onDel={this.toDel}
/>
{/* <span
onClick={() => {
this.toDimission(row);
}}
style="color:#409EFF;margin-left:10px;cursor:pointer"
>
<i class="el-icon-document-delete"></i>
离职
</span> */}
<el-button
type="text"
icon="el-icon-refresh-left"
size="mini"
onClick={() => {
this.handleReback(row);
}}
title="复职"
>
复职
</el-button>
</div>
) : (
<div> <div>
<table-buttons <table-buttons
noAdd noAdd
......
<template> <template>
<div class="page"> <div class="page">
<LayoutTable :data="tableData" :config="tableConfig" /> <LayoutTable :data="tableData" :config="tableConfig" ref="layouttable" />
<dialog-show ref="dialogform" @ok="getData" /> <dialog-show ref="dialogform" @ok="getData" />
<el-dialog title="用户已分配的角色" :visible.sync="role.visible"> <el-dialog title="用户已分配的角色" :visible.sync="role.visible">
...@@ -49,6 +49,9 @@ import table from "@/assets/mixins/table"; ...@@ -49,6 +49,9 @@ import table from "@/assets/mixins/table";
export default { export default {
mixins: [table], mixins: [table],
components: { dialogShow }, components: { dialogShow },
mounted() {
console.log(this.$refs.layouttable.$refs.searchform);
},
methods: { methods: {
// 打开弹窗 // 打开弹窗
async findRole({ id }) { async findRole({ id }) {
...@@ -223,6 +226,9 @@ export default { ...@@ -223,6 +226,9 @@ export default {
name: "userType", name: "userType",
type: "select", type: "select",
label: "用户类型", label: "用户类型",
change: (val) => {
console.log(val);
},
}, },
{ {
name: "loginName", name: "loginName",
......
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